/* الطيب حسابات — الواجهة: قائمة فحمي على اليمين، كروت بيضا، أخضر وتيل، أيقونات مجسمة */
:root {
  --sidebar: #2f3033;
  --sidebar-hover: #3b3c40;
  --sidebar-active: #45464b;
  --sidebar-text: #e9eaec;
  --sidebar-muted: #a9abb0;
  --page: #f6f7f9;
  --card: #ffffff;
  --soft: #f4f7f8;
  --line: #e4e7eb;
  --text: #1d2330;
  --muted: #6b7280;
  --green: #2ca01c;
  --green-dark: #23860f;
  --teal: #0d8d8f;
  --teal-soft: #e3f5f4;
  --teal-line: #9fd8d4;
  --danger: #c0392b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .06);
  --shadow-up: 0 10px 30px rgba(13, 141, 143, .18), 0 2px 6px rgba(16, 24, 40, .06);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}
/* ===== الوضع الليلي: رمادي أزرق هادئ (مش أسود)، بنفس هوية التيل والأخضر ===== */
html[data-theme="dark"] {
  color-scheme: dark;
  --sidebar: #3d4552;
  --sidebar-hover: #48515f;
  --sidebar-active: #525c6b;
  --sidebar-text: #f3f5f8;
  --sidebar-muted: #c9d0d9;
  --page: #515b69;
  --card: #5d6777;
  --soft: #66717f;
  --line: #74808f;
  --text: #f7f9fb;
  --muted: #d3d9e0;
  --green: #34b524;
  --green-dark: #2ca01c;
  --teal: #3fd0d2;
  --teal-soft: rgba(25, 167, 169, .16);
  --teal-line: #5ccfd1;
  --danger: #ef6b5b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 4px 14px rgba(0, 0, 0, .22);
  --shadow-up: 0 10px 30px rgba(25, 167, 169, .22), 0 2px 6px rgba(0, 0, 0, .3);
}
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background-color: var(--soft); color: var(--text); border-color: var(--line); }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #c0c8d2; }
html[data-theme="dark"] tbody tr:nth-child(even) td { background-color: rgba(255, 255, 255, .045); }
html[data-theme="dark"] tbody tr:hover td { background-color: rgba(25, 167, 169, .10); }
html[data-theme="dark"] img.icon3d, html[data-theme="dark"] .dept-card img { filter: brightness(.96); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #7a8594; }
.theme-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; }
.theme-btn:hover { background: var(--soft); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--page); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ===== الدخول: نموذج يمين ورسمة يسار فوق خلفية تيل، والفوتر تحت ===== */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 32px 20px 18px;
  background: linear-gradient(180deg, #5fa9a8 0%, #2f9497 52%, var(--page) 52%); }
.lg-shell { width: 100%; max-width: 1080px; min-height: 580px; display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(8, 60, 62, .22), 0 4px 14px rgba(16, 24, 40, .08); }
.lg-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 44px 56px; }
.lg-form > * { width: 100%; max-width: 360px; }
.lg-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; font-size: 17px; margin-bottom: 18px; }
.lg-brand img { width: 64px; height: 64px; }
.lg-form h1 { text-align: center; font-size: 26px; margin: 0 0 6px; }
.lg-sub { text-align: center; color: var(--muted); margin: 0 0 26px; font-size: 15px; }
.lg-input { position: relative; margin-bottom: 14px; }
.lg-input input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 44px; background: var(--soft); outline: none; font-size: 15px;
  transition: border-color .15s, box-shadow .15s, background .15s; }
.lg-input input:focus { border-color: var(--teal); background: var(--card); box-shadow: 0 0 0 3px rgba(13, 141, 143, .15); }
.lg-code input { text-align: right; letter-spacing: .5px; }
.lg-code input:not(:placeholder-shown) { text-align: left; text-transform: uppercase; }
.lg-ic { position: absolute; top: 50%; right: 14px; width: 20px; height: 20px; transform: translateY(-50%); color: #8a929e; pointer-events: none; }
.lg-input:focus-within .lg-ic { color: var(--teal); }
.lg-ic svg, .lg-eye svg { width: 100%; height: 100%; display: block; }
.lg-eye { position: absolute; top: 50%; left: 10px; width: 32px; height: 32px; padding: 6px; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.lg-eye:hover { background: var(--soft); color: var(--text); }
.lg-remember { display: flex; align-items: center; gap: 8px; margin: 2px 0 18px; cursor: pointer; user-select: none; font-size: 14px; }
.lg-remember input { width: 18px; height: 18px; accent-color: var(--green); margin: 0; cursor: pointer; }
.lg-btn { height: 50px; font-size: 16px; border-radius: 10px; box-shadow: 0 6px 16px rgba(44, 160, 28, .25); }
.lg-form .error { text-align: center; }
.lg-help { text-align: center; color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }
.lg-help b { color: var(--teal); font-weight: 600; }
.lg-art { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 36px; color: #fff;
  background: radial-gradient(120% 90% at 20% 10%, #92c4c0 0%, transparent 60%), linear-gradient(160deg, #7cb8b6 0%, #57a5a6 45%, #3d989b 100%); }
.lg-art h2 { margin: 0; font-size: 24px; font-weight: 700; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.lg-art img { width: 100%; max-width: 440px; aspect-ratio: 840 / 800; object-fit: cover;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }
.lg-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lg-chips span { background: var(--card); color: var(--text); font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.lg-foot { color: var(--muted); font-size: 13px; }
.lg-foot a { color: var(--teal); }
@media (max-width: 860px) {
  .login { background: linear-gradient(180deg, #5fa9a8 0%, #2f9497 30%, var(--page) 30%); justify-content: flex-start; }
  .lg-shell { grid-template-columns: 1fr; min-height: 0; }
  .lg-art { display: none; }
  .lg-form { padding: 36px 22px; }
}
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 500; font-size: 13px; }
.field input { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--card); outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 141, 143, .15); }
.btn-primary { width: 100%; height: 44px; border: 0; border-radius: 10px; background: var(--green); color: #fff; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.error { color: var(--danger); min-height: 20px; font-size: 13px; margin-top: 10px; }

/* ===== الهيكل ===== */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .wordmark { font-weight: 700; font-size: 21px; padding: 22px 22px 18px; letter-spacing: 0; }
.btn-new { margin: 0 18px 18px; height: 40px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: #fff; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s; }
.btn-new:hover { background: rgba(255, 255, 255, .08); }
.btn-new .plus { color: var(--green); font-size: 20px; line-height: 1; }
.nav { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 11px 22px; color: var(--sidebar-text); border-inline-end: 4px solid transparent; transition: background .15s; }
.nav a:hover { background: var(--sidebar-hover); }
.nav a.active { background: var(--sidebar-active); border-inline-end-color: var(--green); font-weight: 600; }
.nav a .caret { margin-inline-start: auto; color: var(--sidebar-muted); font-size: 12px; transition: transform .2s; }
.nav a.open .caret { transform: rotate(-90deg); }
.nav .sub { list-style: none; margin: 0; padding: 2px 0 6px; background: rgba(0, 0, 0, .12); }
.nav .sub a { padding: 8px 40px 8px 22px; font-size: 13px; color: var(--sidebar-muted); }
.nav .sub a:hover, .nav .sub a.active { color: #fff; }
.nav .sub a.active { border-inline-end-color: transparent; background: transparent; font-weight: 600; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar { height: 60px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 5; }
.topbar .company { font-weight: 600; }
.topbar .tools { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: #4b5563; display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.icon-btn:hover { background: var(--soft); }
.icon-btn svg { width: 21px; height: 21px; }
.sep { width: 1px; height: 26px; background: var(--line); margin: 0 6px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--green); display: grid; place-items: center; color: #fff; border: 0; cursor: pointer; position: relative; }
.avatar svg { width: 20px; height: 20px; }
.menu-pop { position: absolute; top: 46px; inset-inline-end: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 190px; padding: 6px; color: var(--text); text-align: start; }
.menu-pop .who { padding: 8px 10px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-pop button { width: 100%; text-align: start; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.menu-pop button:hover { background: var(--soft); }

.content { padding: 26px 28px 28px; flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; }

/* ===== البانر الزجاجي ===== */
.banner { position: relative; overflow: hidden; border-radius: 16px; border: 1px solid #d9ece9; padding: 26px 30px 0; margin-bottom: 26px;
  background:
    radial-gradient(420px 180px at 12% 20%, rgba(255, 255, 255, .95), transparent 70%),
    radial-gradient(600px 240px at 70% 120%, rgba(13, 141, 143, .14), transparent 70%),
    linear-gradient(115deg, #f5fbfa 0%, #e2f3f1 38%, #f3faf9 62%, #d9efec 100%);
  box-shadow: 0 6px 24px rgba(13, 141, 143, .10); }
.banner::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 70%; height: 180%; transform: rotate(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); pointer-events: none; }
.banner .row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.banner h1 { margin: 0; font-size: 30px; font-weight: 700; }
.banner p { margin: 6px 0 0; color: #4b5563; font-size: 15px; }
.banner .art { width: 160px; height: 160px; margin-top: -10px; flex: none; filter: drop-shadow(0 10px 14px rgba(15, 30, 61, .18)); margin-bottom: 8px; }
.tabs { position: relative; display: flex; gap: 26px; margin-top: 14px; }
.tabs button { border: 0; background: none; padding: 10px 0 12px; color: var(--muted); cursor: pointer; font-weight: 500; border-bottom: 3px solid transparent; }
.tabs button.active { color: var(--text); font-weight: 700; border-bottom-color: var(--green); }

/* ===== الكروت الحية: اسم القسم وأيقونته بس ===== */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; perspective: 1000px; }
.card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px 16px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); cursor: pointer; outline: none;
  transform-style: preserve-3d; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, background-color .3s, border-color .3s; will-change: transform; }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .75), transparent 60%); mix-blend-mode: soft-light; }
.card.live { transition: transform .08s linear, box-shadow .3s, background-color .3s, border-color .3s; }
.card:hover, .card:focus-visible { --ty: -6px; background: linear-gradient(160deg, #f2fbfa 0%, #e2f4f2 100%); border-color: var(--teal-line); box-shadow: var(--shadow-up); }
.card:hover::after, .card:focus-visible::after { opacity: 1; }
.card:focus-visible { box-shadow: var(--shadow-up), 0 0 0 3px rgba(13, 141, 143, .35); }
.card .ic { width: 150px; height: 150px; max-width: 100%; object-fit: contain; flex: none; transform: translateZ(46px) translate(var(--ix, 0px), var(--iy, 0px)) scale(var(--is, 1));
  transition: transform .45s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 10px 12px rgba(15, 30, 61, .12)); }
.card.live .ic { transition: transform .08s linear; }
.card:hover .ic { --is: 1.07; }
.card .text { display: flex; align-items: center; gap: 8px; transform: translateZ(24px); }
.card h3 { margin: 0; font-size: 19px; font-weight: 700; }
.card .go { color: var(--green); font-weight: 700; opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .25s; }
.card:hover .go, .card:focus-visible .go { opacity: 1; transform: none; }
.card.small .ic { width: 96px; height: 96px; }
.card.small h3 { font-size: 16px; }

.section-title { font-size: 15px; color: var(--muted); margin: 0 0 14px; font-weight: 600; }
.empty { background: var(--card); border: 1px dashed #cfd5dc; border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); }

/* ===== شاشة القائمة ===== */
.listbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; min-width: 260px; background: var(--card); outline: none; }
.search:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 141, 143, .15); }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--soft); color: var(--muted); font-weight: 600; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .18s, box-shadow .18s, transform .18s; }
tbody tr:nth-child(even) { background: var(--soft); }
tbody tr:hover { background: var(--teal-soft); box-shadow: inset -4px 0 0 var(--teal), 0 2px 10px rgba(13, 141, 143, .10); transform: translateX(-3px); position: relative; }
tbody tr:hover td { color: #0b2f3a; }
td.num { font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid transparent; }
.tone-neutral { background: var(--soft); color: #3f4855; }
.tone-ok { background: #e3f5df; color: #1f7a12; border-color: #c4e8bd; }
.tone-draft { background: var(--soft); color: #5b6472; border-color: var(--line); }
.tone-wait { background: #fff4dc; color: #8a5a00; border-color: #f6dfa5; }
.tone-info { background: #e2f1fb; color: #155e8f; border-color: #bfdff3; }
.tone-bad { background: #fde7e5; color: #a8291c; border-color: #f6c6c0; }
.pager { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.pager button { height: 34px; padding: 0 12px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; cursor: pointer; }
.pager button:disabled { opacity: .5; cursor: default; }

/* ===== الفوتر ===== */
.footer { border-top: 1px solid var(--line); background: var(--soft); color: var(--muted); font-size: 13px; padding: 14px 28px; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; text-align: center; }
.footer .brand { color: var(--text); font-weight: 600; }
.footer .dot { color: #c3c8cf; }
.footer a { color: var(--teal); font-weight: 600; border-bottom: 1px solid transparent; transition: border-color .2s, color .2s; }
.footer a:hover, .footer a:focus-visible { color: var(--green-dark); border-bottom-color: currentColor; }

/* ===== الشاشات الصغيرة ===== */
@media (max-width: 1200px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 260px; z-index: 20; transform: translateX(100%); transition: transform .25s; }
  .shell.menu-open .sidebar { transform: none; box-shadow: -10px 0 30px rgba(0, 0, 0, .25); }
  .menu-toggle { display: grid !important; }
  .topbar, .content, .footer { padding-inline: 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card .ic { width: 110px; height: 110px; }
  .banner { padding: 20px 18px 0; }
  .banner h1 { font-size: 24px; }
  .banner .art { width: 84px; height: 84px; }
  .search { min-width: 0; width: 100%; }
}
.menu-toggle { display: none !important; }
@media (prefers-reduced-motion: reduce) { .card, .card .ic { transition: none !important; transform: none !important; } }

/* ===== جوه القسم: زي أودو (شريط فحمي بقوائم القسم، من غير قائمة جانبية) ===== */
.appbar, .controlbar { display: none; }
.shell.in-dept { grid-template-columns: 1fr; }
.shell.in-dept .sidebar, .shell.in-dept .topbar { display: none; }
.shell.in-dept .appbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 52px; padding: 0 20px; background: var(--sidebar); color: #fff; position: sticky; top: 0; z-index: 10; }
.shell.in-dept .controlbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 8px 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 52px; z-index: 9; flex-wrap: wrap; }
.app-start, .app-end { display: flex; align-items: center; gap: 6px; min-width: 0; }
.grid-btn { width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; display: grid; place-items: center; transition: background .15s; }
.grid-btn:hover, .grid-btn:focus-visible { background: rgba(255, 255, 255, .1); }
.dots { display: grid; grid-template-columns: repeat(3, 4px); gap: 3px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--soft); }
.app-name { font-weight: 700; font-size: 17px; color: #fff; padding: 6px 10px; border-radius: 8px; }
.app-name:hover { background: rgba(255, 255, 255, .08); }
.app-menus { display: flex; align-items: center; gap: 2px; }
.appmenu { position: relative; }
.appmenu > button { height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #d7d9dd; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; transition: background .15s, color .15s; }
.appmenu > button:hover, .appmenu > button[aria-expanded="true"] { background: rgba(255, 255, 255, .1); color: #fff; }
.chev { font-size: 11px; opacity: .8; }
.dd { position: absolute; top: 44px; inset-inline-start: 0; min-width: 230px; max-height: 70vh; overflow: auto; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, .16); padding: 6px; z-index: 30; }
.dd-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--text); }
a.dd-item:hover, a.dd-item:focus-visible { background: var(--teal-soft); color: #0b2f3a; }
.dd-item.soon { color: var(--muted); cursor: default; }
.dd-item small { font-size: 11px; background: var(--soft); color: var(--muted); padding: 1px 8px; border-radius: 999px; }
.app-company { color: #c9ccd1; font-size: 13px; margin-inline-end: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.icon-btn.light { color: #d7d9dd; }
.icon-btn.light:hover { background: rgba(255, 255, 255, .1); }

/* مسار التنقل: كل حلقة رابط يرجّع لها */
.crumbs { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 15px; }
.crumbs li { display: flex; align-items: center; gap: 4px; }
.crumbs li + li::before { content: "‹"; color: var(--muted); margin: 0 4px; }
.crumbs a { color: var(--teal); font-weight: 500; padding: 2px 4px; border-radius: 6px; }
.crumbs a:hover, .crumbs a:focus-visible { background: var(--teal-soft); text-decoration: underline; }
.crumbs [aria-current] { color: var(--text); font-weight: 700; }
.controlbar .search { min-width: 280px; }

.dash-head { margin: 4px 0 20px; }
.dash-head h1 { margin: 0; font-size: 26px; }
.dash-head p { margin: 6px 0 0; color: var(--muted); }
.card.soon { cursor: default; }
.card.soon .ic { filter: grayscale(.35) opacity(.75) drop-shadow(0 10px 12px rgba(15, 30, 61, .1)); }
.badge-soon { font-size: 11.5px; background: var(--soft); color: var(--muted); padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.list-title { margin: 0; font-size: 22px; }
tr.clickable { cursor: pointer; }
tr.clickable:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }

.placeholder { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 40px 24px; text-align: center; box-shadow: var(--shadow); }
.placeholder img { width: 160px; height: 160px; object-fit: contain; }
.placeholder h2 { margin: 8px 0 6px; }
.placeholder p { margin: 0; color: var(--muted); }

/* شاشة السجل */
.sheet { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 24px 28px; display: grid; gap: 20px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sheet-head h1 { margin: 0; font-size: 24px; direction: auto; }
.fields { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: 10px 20px; margin: 0; }
.fields dt { color: var(--muted); font-size: 13px; align-self: center; }
.fields dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.rel { color: var(--teal); border-bottom: 1px dashed currentColor; }
.rel:hover { color: var(--green-dark); }
.table-wrap.detail { box-shadow: none; }

/* اللوحة الجانبية المختصرة */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-back { position: absolute; inset: 0; background: rgba(15, 20, 30, .35); opacity: 0; transition: opacity .2s; }
.drawer-panel { position: absolute; inset-block: 0; inset-inline-start: 0; width: 280px; max-width: 86vw; background: var(--sidebar); color: #fff; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; transform: translateX(100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); overflow-y: auto; }
.drawer.open .drawer-back { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 18px; padding: 4px 8px 12px; }
.drawer-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: #e9eaec; transition: background .15s; }
.drawer-item img { width: 44px; height: 44px; object-fit: contain; }
.drawer-item:hover, .drawer-item:focus-visible, .drawer-item.active { background: rgba(255, 255, 255, .1); color: #fff; }
.drawer-item.active { box-shadow: inset -3px 0 0 var(--green); }

@media (max-width: 900px) {
  .app-menus { overflow-x: auto; max-width: 52vw; }
  .app-company { display: none; }
  .fields { grid-template-columns: max-content 1fr; }
}
@media (max-width: 760px) {
  .shell.in-dept .appbar { padding: 0 10px; }
  .shell.in-dept .controlbar { padding: 8px 16px; }
  .controlbar .search { min-width: 0; width: 100%; }
}

/* ===== شاشة الفاتورة ===== */
.btn { height: 38px; padding: 0 16px; border-radius: 9px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }
.btn-line { background: var(--card); color: var(--text); border-color: #cfd5dc; }
.btn-line:hover { border-color: var(--teal); color: var(--teal); }
.inv-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.inv-actions .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.stepper { list-style: none; display: flex; margin: 0; padding: 0; }
.stepper li { position: relative; padding: 7px 18px 7px 22px; background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 600; clip-path: polygon(12px 0, 100% 0, calc(100% - 0px) 100%, 12px 100%, 0 50%); margin-inline-start: -6px; }
.stepper li:first-child { margin-inline-start: 0; }
.stepper li.done { background: #dff1f0; color: var(--teal); }
.stepper li.on { background: var(--green); color: #fff; }
.inv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.inv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inv-head h1 { margin: 0; font-size: 26px; direction: ltr; text-align: right; }
.smart { display: flex; gap: 8px; }
.smart-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 72px; height: 54px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.smart-btn strong { font-size: 17px; color: var(--teal); line-height: 1.1; }
.smart-btn span { font-size: 12px; color: var(--muted); }
.smart-btn:hover, .smart-btn:focus-visible { border-color: var(--teal-line); box-shadow: 0 4px 12px rgba(13, 141, 143, .14); transform: translateY(-2px); }
.inv-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; }
.inv-fields .f { display: grid; gap: 4px; min-width: 0; }
.inv-fields .f span { color: var(--muted); font-size: 12.5px; }
.inv-fields .f b { font-weight: 600; overflow-wrap: anywhere; }
.inv-tabs { margin-top: 0; border-bottom: 1px solid var(--line); }
.totals { display: grid; grid-template-columns: max-content max-content; justify-content: end; gap: 8px 32px; margin: 0; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: left; }
.totals .grand { color: var(--text); font-weight: 700; font-size: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.totals .due { color: var(--teal); font-weight: 700; }
.history { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); position: sticky; top: 124px; }
.history h3 { margin: 0 0 12px; font-size: 16px; }
.history ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.history li { display: flex; gap: 10px; align-items: flex-start; }
.history .who { width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--muted); display: grid; place-items: center; flex: none; }
.history .who svg { width: 18px; height: 18px; }
.history p { margin: 0; font-weight: 500; }
.history small { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.modal-back { position: fixed; inset: 0; background: rgba(15, 20, 30, .4); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--card); border-radius: 16px; padding: 22px; width: 100%; max-width: 420px; box-shadow: 0 20px 50px rgba(16, 24, 40, .3); }
.modal h2 { margin: 0 0 16px; font-size: 19px; }
.modal select { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--card); }
.modal-btns { display: flex; gap: 8px; margin-top: 8px; }
@media (max-width: 1000px) { .inv-layout { grid-template-columns: 1fr; } .history { position: static; } }
@media print { .appbar, .controlbar, .inv-actions, .history, .footer, .smart { display: none !important; } .content { padding: 0; } .sheet { box-shadow: none; border: 0; } }

/* ===== الحضور اليومي ===== */
.date-pick { display: flex; align-items: center; gap: 6px; }
.pill-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 16px; color: var(--text); }
.pill-btn:hover { border-color: var(--teal); color: var(--teal); }
.date-input { height: 36px; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; background: var(--card); direction: ltr; }
.date-label { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; color: var(--text); transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--teal-line); }
.chip.on { background: var(--teal-soft); border-color: var(--teal); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; border: 0; padding: 0; }
.dot.tone-ok { background: #2ca01c; } .dot.tone-wait { background: #e3a008; } .dot.tone-bad { background: #d64535; } .dot.tone-orange { background: #ef7d22; } .dot.tone-info { background: var(--teal); }
.tone-orange { background: #fff0e3; color: #a4500b; border-color: #f8d2ae; }
.emp { display: inline-flex; align-items: center; gap: 10px; }
.emp .who { width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--muted); display: grid; place-items: center; }
.emp .who svg { width: 18px; height: 18px; }
.worked { display: inline-flex; align-items: center; gap: 10px; }
.tl { position: relative; display: inline-block; width: 120px; height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.tl i, .tl b { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.tl i { background: var(--teal); }
.tl b { background: #e3a008; }
@media (max-width: 760px) { .tl { width: 70px; } }

/* ===== بطاقات الموظفين ===== */
.tools { display: flex; align-items: center; gap: 8px; }
.viewsw { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.viewsw button { width: 36px; height: 34px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.viewsw button svg { width: 17px; height: 17px; }
.viewsw button[aria-pressed="true"] { background: var(--teal); color: #fff; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 14px; }
@media (max-width: 1200px) { .kanban { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kanban { grid-template-columns: 1fr; padding: 10px; } }
.ecard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 1px 2px rgba(20,30,40,.04); transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.ecard:hover, .ecard:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(13,141,143,.12); border-color: var(--teal-line); outline: none; }
.ecard.inactive { opacity: .62; }
.ecard-top { display: flex; align-items: flex-start; gap: 10px; }
.eav { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(160deg, #eef3f5, #dbe4e8); color: #8a97a3; display: grid; place-items: center; }
.eav svg { width: 28px; height: 28px; }
.eav .st { position: absolute; bottom: 1px; left: 1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; }
.st.on { background: #2ca01c; } .st.off { background: #a7b0ba; }
.ecard .who { flex: 1; min-width: 0; }
.ecard h3 { margin: 2px 0 2px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecard .who p { margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecard .code { font-size: 12px; font-weight: 700; color: #5b6472; background: var(--soft); border-radius: 6px; padding: 2px 7px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: #3f4855; }
.tag.fp { background: var(--teal-soft); color: #0b6f71; }
.tag.fp svg { width: 13px; height: 13px; display: block; }
.ecard-foot { border-top: 1px solid var(--line); padding-top: 9px; margin-top: auto; }
.today { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; background: none !important; border: 0 !important; padding: 0; }
.table-wrap:has(> .kanban) { background: none; border: 0; box-shadow: none; overflow: visible; }
.table-wrap > .kanban { padding: 0; }

/* ===== التقارير ===== */
.rep-params { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.rp-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.rp-field input, .rp-field select { height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--card); min-width: 170px; color: var(--text); font: inherit; }
.rep-params .btn { height: 38px; }
.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rep-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.rep-card span { color: var(--muted); font-size: 13px; }
.rep-card b { font-size: 18px; font-variant-numeric: tabular-nums; }
.rep-card b.neg { color: #a8291c; }
.rep-h { font-size: 16px; margin: 18px 0 8px; }
table.rep td.num, table.rep th.num { text-align: left; font-variant-numeric: tabular-nums; }
table.stmt tr.k-section td { font-weight: 700; background: var(--soft); }
table.stmt tr.k-group td { font-weight: 600; }
table.stmt tr.k-computed td { font-weight: 700; border-top: 2px solid var(--text); }
.acc-code { color: var(--muted); font-size: 12px; }
@media print { .rep-params, .appbar, .controlbar, .footer { display: none !important; } }
.dot.tone-draft { background: #9aa5b1; }

/* ===== سجل الموظف ===== */
.emp-head { display: flex; align-items: center; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.eav.big { width: 84px; height: 84px; }
.eav.big svg { width: 52px; height: 52px; }
.eav.big .st { width: 16px; height: 16px; border-width: 3px; bottom: 3px; left: 3px; }
.emp-head .who { flex: 1; min-width: 0; }
.emp-head h1 { margin: 0 0 2px; font-size: 24px; }
.emp-head .who > p { margin: 0 0 10px; color: var(--muted); }
.emp-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { min-width: 116px; border-radius: 12px; padding: 10px 14px; color: #fff; display: flex; flex-direction: column; gap: 4px; }
.stat span { font-size: 12.5px; opacity: .92; }
.stat b { font-size: 24px; font-variant-numeric: tabular-nums; }
.s-green { background: linear-gradient(160deg, #3bb52a, #26901a); }
.s-amber { background: linear-gradient(160deg, #f0b23a, #d8950f); }
.s-teal { background: linear-gradient(160deg, #18a3a5, #0b7a7c); }
.emp-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.emp-side { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px; }
.emp-side dl { margin: 0; }
.emp-side dt { color: var(--muted); font-size: 13px; padding-top: 12px; }
.emp-side dd { margin: 4px 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-weight: 600; }
.emp-side dd:last-child { border-bottom: 0; }
.emp-main { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 16px 16px; min-width: 0; }
.emp-body { padding-top: 14px; }
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; }
.cal-nav h2 { margin: 0; font-size: 18px; min-width: 140px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-h { text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal-cell { min-height: 74px; border-radius: 10px; padding: 7px 8px; display: flex; flex-direction: column; gap: 3px; border: 1px solid transparent; background: var(--soft); }
.cal-cell.blank { background: none; }
.cal-cell.today { outline: 2px solid var(--teal); outline-offset: 1px; }
.cal-d { font-weight: 700; font-size: 13px; }
.cal-t { font-size: 11.5px; font-variant-numeric: tabular-nums; text-align: right; }
.cal-s { font-size: 11px; font-weight: 600; }
.k-present { background: #e3f5df; color: #1f6a14; }
.k-late { background: #fff1d6; color: #8a5a00; }
.k-absent { background: #fde4e1; color: #a8291c; }
.k-incomplete { background: #ffe9d6; color: #a4500b; }
.k-leave { background: #e2f1fb; color: #155e8f; }
.k-off, .k-off_worked { background: var(--soft); color: #6b7480; }
.k-future, .k-none { background: var(--soft); color: #a0a8b2; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.rep-card small.muted { color: var(--muted); font-size: 12px; }
@media (max-width: 1000px) { .emp-grid { grid-template-columns: 1fr; } .emp-head { flex-wrap: wrap; } }
@media (max-width: 640px) { .cal-cell { min-height: 54px; padding: 4px; } .cal-t, .cal-s { display: none; } }
.emp-main .tabs button.active { border-bottom-color: var(--teal); }

/* ===== مسير الرواتب ===== */
.btn-teal { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-teal:hover { filter: brightness(1.06); }
.pr-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.pr-tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.pr-tile span { color: var(--muted); font-size: 13px; }
.pr-tile b { font-size: 22px; font-variant-numeric: tabular-nums; }
.pr-tile.em { border-color: #c4e8bd; background: linear-gradient(180deg, #f3fbf1, #fff); }
.pr-tile.em b { color: #1f7a12; }
.pr-table td.neg { color: #a8291c; }
.pr-table td.strong, .pr-table tfoot td { font-weight: 700; }
.pr-table tfoot td { background: var(--soft); border-top: 2px solid var(--line); }
.listbar .btns { display: flex; gap: 8px; }
.listbar .smart-btn { height: 38px; flex-direction: row; font-weight: 600; text-decoration: none; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #2f3033; color: #fff; padding: 12px 18px; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 60; max-width: min(560px, calc(100% - 32px)); transition: opacity .5s; }
.toast.out { opacity: 0; }
@media (max-width: 900px) { .pr-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== الحسابات الافتراضية ===== */
table.defaults td.muted { color: var(--muted); font-size: 13px; }
.def-cell { display: flex; align-items: center; gap: 10px; }
.def-cell select { height: 36px; min-width: 300px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--card); font: inherit; color: var(--text); }
.save-state { font-size: 12.5px; color: var(--muted); }
.save-state.ok { color: #1f7a12; }
.save-state.bad { color: #a8291c; }
@media (max-width: 760px) { .def-cell { flex-direction: column; align-items: stretch; } .def-cell select { min-width: 0; } }

/* ===== صفحات الإعدادات ===== */
.set-bar { display: flex; align-items: center; gap: 10px; }
.dirty-note { color: #8a5a00; background: #fff4dc; border: 1px solid #f6dfa5; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; }
.save-msg { font-size: 13px; color: var(--muted); }
.save-msg.ok { color: #1f7a12; } .save-msg.bad { color: #a8291c; }
.set-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.set-index { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.set-index a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; border-inline-start: 3px solid transparent; font-size: 14px; }
.set-index a:hover { background: var(--soft); }
.set-index a.on { background: var(--teal-soft); color: #0b6f71; border-inline-start-color: var(--teal); font-weight: 700; }
.set-note { background: #fff4dc; border: 1px solid #f6dfa5; color: #6b4600; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.set-sec { margin-bottom: 22px; scroll-margin-top: 80px; }
.set-sec h2 { font-size: 16px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.set-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.set-card.ro { background: var(--soft); }
.set-t { font-weight: 700; }
.set-t .req { color: #a8291c; }
.set-card p { margin: 0; color: var(--muted); font-size: 13px; }
.set-ctl { margin-top: 4px; }
.set-ctl input, .set-ctl select { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--card); font: inherit; color: var(--text); }
.set-ctl input:disabled, .set-ctl select:disabled { background: var(--soft); color: #6b7480; }
.set-ctl input:focus, .set-ctl select:focus { outline: 2px solid var(--teal-line); border-color: var(--teal); }
.with-unit, .with-icon { display: flex; align-items: stretch; }
.with-unit input { border-start-end-radius: 0; border-end-end-radius: 0; }
.with-unit span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); border-inline-start: 0; border-radius: 0 8px 8px 0; background: var(--soft); color: var(--muted); font-size: 13px; }
[dir="rtl"] .with-unit span { border-radius: 8px 0 0 8px; }
.with-icon { position: relative; }
.with-icon .eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; opacity: .6; }
.switch { width: 46px; height: 26px; border-radius: 999px; border: 0; background: #cfd6dd; position: relative; cursor: pointer; transition: background .15s; padding: 0; }
.switch i { position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: inset-inline-start .15s; }
.switch.on { background: var(--teal); }
.switch.on i { inset-inline-start: 23px; }
.switch:disabled { opacity: .5; cursor: default; }
@media (max-width: 900px) { .set-layout { grid-template-columns: 1fr; } .set-index { position: static; flex-direction: row; overflow-x: auto; } .set-grid { grid-template-columns: 1fr; } }
.set-link { display: inline-flex; align-items: center; gap: 4px; color: var(--teal); font-weight: 700; text-decoration: none; padding: 6px 0; }
.set-link:hover { text-decoration: underline; }

/* ===== إقفال الفترة ===== */
.close-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; }
.close-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.close-item { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ci-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; }
.close-item.ok .ci-mark { background: #e3f5df; color: #1f7a12; }
.close-item.warn .ci-mark { background: #fff4dc; color: #8a5a00; }
.close-item.bad .ci-mark { background: #fde7e5; color: #a8291c; }
.close-item.bad { border-color: #f6c6c0; }
.ci-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ci-text small { color: var(--muted); }
.close-actions { margin-top: 16px; display: flex; justify-content: flex-start; }
@media (max-width: 760px) { .close-list { grid-template-columns: 1fr; } }
.wd { display: flex; flex-wrap: wrap; gap: 6px; }
.wd .chip { height: 30px; padding: 0 10px; font-size: 13px; }
.modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; resize: vertical; }
.modal { max-height: calc(100vh - 40px); overflow-y: auto; }
/* حقول النماذج داخل الحوار: العنوان فوق الحقل */
.modal .field label { display: grid; gap: 6px; }
.modal .field select { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--card); font: inherit; color: var(--text); }
.modal .field select:focus, .modal .field textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(13, 141, 143, .15); }
.modal .field .switch { justify-self: start; }

/* ===== نموذج الفاتورة (زي أودو): حقول بعمودين، بنود قابلة للتعديل، إجماليات، واختيار بالبحث ===== */
.of-kind { color: var(--muted); font-size: 13px; font-weight: 600; }
.of-sheet .inv-head h1 { margin-top: 2px; }
.of-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 48px; }
.of-col { display: grid; gap: 6px; align-content: start; }
.of { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: start; gap: 12px; min-height: 36px; }
.of > label { font-weight: 600; font-size: 13.5px; padding-top: 8px; }
.of-v { min-width: 0; }
.of-v input, .of-v select { width: 100%; height: 36px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 0 2px; font: inherit; outline: none; transition: border-color .15s; }
.of-v input:hover, .of-v select:hover { border-bottom-color: #b9c2cc; }
.of-v input:focus, .of-v select:focus { border-bottom: 2px solid var(--teal); }
.of-ro { padding: 8px 2px; min-height: 36px; overflow-wrap: anywhere; }
.of-addr { color: var(--muted); font-size: 13px; padding: 4px 2px 0; white-space: pre-line; }
.of-addr:empty { display: none; }
.pk { position: relative; }
.pk-list { position: absolute; z-index: 30; top: calc(100% + 4px); inset-inline: 0; min-width: 240px; max-height: 280px; overflow: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px rgba(16, 24, 40, .14); }
.pk-list li { display: flex; gap: 8px; align-items: baseline; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.pk-list li small { color: var(--muted); font-size: 12px; }
.pk-list li.hi, .pk-list li:hover { background: var(--teal-soft); }
.pk-list li.none { color: var(--muted); cursor: default; background: none; }
.of-lines table { min-width: 980px; }
.of-lines td { vertical-align: middle; }
.of-lines input, .of-lines select { width: 100%; height: 34px; border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 0 6px; font: inherit; outline: none; }
.of-sheet.editing .of-lines tbody tr:hover input, .of-sheet.editing .of-lines tbody tr:hover .pk-in { border-color: var(--line); background: var(--card); }
.of-lines input:focus { border-color: var(--teal) !important; background: var(--card); box-shadow: 0 0 0 3px rgba(13, 141, 143, .12); }
.of-lines .ln-num { text-align: left; width: 90px; }
.of-lines .ln-disc { width: 64px; }
.ln-prod { min-width: 170px; } .ln-acc { min-width: 150px; color: var(--muted); }
.ln-desc { min-width: 180px; }
.ln-total { font-weight: 600; white-space: nowrap; }
.ln-del button { border: 0; background: none; cursor: pointer; opacity: .45; font-size: 15px; padding: 4px; border-radius: 6px; }
.ln-del button:hover { opacity: 1; background: #fdecea; }
.ln-empty { text-align: center; padding: 22px !important; }
.tx { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tx-chip { display: inline-flex; align-items: center; gap: 4px; background: #e6f4e3; color: #1f7a12; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.tx-chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 2px; font-size: 13px; line-height: 1; }
.of-lines .tx-add { width: 34px; height: 24px; padding: 0; border: 1px dashed #b9c2cc; border-radius: 999px; color: var(--muted); text-align: center; cursor: pointer; }
.of-add { display: flex; gap: 18px; padding: 10px 4px 0; }
.linkbtn { border: 0; background: none; color: var(--teal); font-weight: 600; cursor: pointer; padding: 4px 0; font: inherit; font-weight: 600; }
.linkbtn:hover { text-decoration: underline; }
.of-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 32px; margin-top: 22px; align-items: start; }
.of-terms { display: grid; gap: 6px; }
.of-terms label { font-weight: 600; font-size: 13.5px; }
.of-note { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; resize: vertical; min-height: 84px; outline: none; }
.of-note:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 141, 143, .12); }
.of-note-ro { margin: 0; color: var(--muted); white-space: pre-line; }
.of-totals { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; grid-template-columns: 1fr max-content; justify-content: stretch; }
.of-totals .grand { font-size: 18px; }
.inv-actions .badge { font-size: 13px; }
@media (max-width: 900px) { .of-grid, .of-bottom { grid-template-columns: 1fr; } .of { grid-template-columns: 110px minmax(0, 1fr); } }
@media print { .appbar, .crumbs, .inv-actions, .history, .of-add, .ln-del, footer { display: none !important; } .inv-layout { grid-template-columns: 1fr; } }
.st-cancel { background: #fdecea; color: #b42318; font-weight: 700; font-size: 13px; padding: 6px 14px; border-radius: 999px; }
.of-sheet > *, .of-sheet .tabs + div { min-width: 0; }
.of-lines { overflow-x: auto; }
.of-lines .tx-add { appearance: none; -webkit-appearance: none; background: var(--card); font-weight: 700; }
/* نموذج الفاتورة: السجل تحت الورقة في الشاشات المتوسطة (زي أودو)، وجنبها في الشاشات العريضة */
.of-layout { grid-template-columns: minmax(0, 1fr); }
.of-layout .history { position: static; }
@media (min-width: 1600px) { .of-layout { grid-template-columns: minmax(0, 1fr) 300px; } .of-layout .history { position: sticky; } }
.of-lines table { min-width: 900px; }
.je-lines table { min-width: 760px; }
.je-lines tfoot td { font-weight: 700; background: var(--soft); border-top: 2px solid var(--line); }
.je-lines tr.je-diff td { color: var(--danger); background: var(--soft); font-weight: 600; }
.je-rev { background: #fff4e5; color: #b26a00; }
.of-promos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; font-size: 13px; }
/* شاشتا الشريك والصنف */
.mf-sheet { gap: 18px; }
.mf-smart { justify-content: flex-start; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.smart-btn.stat { cursor: default; } .smart-btn.stat:hover { transform: none; box-shadow: none; border-color: var(--line); }
.mf-head { display: flex; gap: 18px; align-items: center; }
.mf-avatar { width: 84px; height: 84px; border-radius: 16px; background: var(--soft); color: var(--muted); display: grid; place-items: center; flex: none; padding: 16px; }
.mf-avatar svg { width: 100%; height: 100%; } .mf-avatar.img { background: var(--soft); object-fit: contain; padding: 8px; }
.mf-title { display: grid; gap: 10px; flex: 1; min-width: 0; }
.mf-name { width: 100%; font: inherit; font-size: 26px; font-weight: 700; border: 0; border-bottom: 1px solid var(--line); padding: 4px 2px; outline: none; background: transparent; }
.mf-name:focus { border-bottom: 2px solid var(--teal); }
.mf-roles { display: flex; flex-wrap: wrap; gap: 18px; }
.mf-check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 500; }
.mf-check input { width: 17px; height: 17px; accent-color: var(--green); margin: 0; }
.mf-area { width: 100%; border: 0; border-bottom: 1px solid var(--line); font: inherit; resize: vertical; padding: 6px 2px; outline: none; background: transparent; }
.mf-area:focus { border-bottom: 2px solid var(--teal); }
.mf-pad { padding-top: 16px; } .mf-h { margin: 0 0 6px; font-size: 14px; color: var(--teal); }
.mf-note { font-size: 13px; margin: 6px 0 0; }
.lf-chip { margin-inline-start: 12px; font-size: 13px; vertical-align: middle; }
/* التحويل المخزني */
.pk-lines table { min-width: 640px; }
.pk-ok { color: #1f7a12; font-weight: 700; } .pk-part { color: #b26a00; font-weight: 700; } .pk-none { color: var(--danger); font-weight: 700; }
.pk-cancel td { color: var(--muted); text-decoration: line-through; }
.pk-desc { display: block; font-size: 12px; }
.pk-hint { margin: 0 0 10px; font-size: 13px; }
/* الدفعة والشيك */
.pay-dir button { padding: 0 14px; width: auto; font-weight: 600; font-size: 13px; }
.pay-on td { background: var(--teal-soft) !important; }
.pay-hint { font-size: 13px; margin: 8px 0 0; }
.chq-tl { list-style: none; margin: 0; padding: 4px 0 0; display: grid; gap: 16px; }
.chq-tl li { display: flex; gap: 12px; align-items: flex-start; position: relative; }
.chq-tl li:not(:last-child)::after { content: ''; position: absolute; inset-inline-start: 6px; top: 18px; bottom: -14px; width: 2px; background: var(--line); }
.chq-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--teal); flex: none; margin-top: 4px; box-shadow: 0 0 0 4px var(--teal-soft); }
.chq-tl p { margin: 2px 0; font-size: 13px; }
.chq-tl a { font-size: 13px; }
/* التصنيع */
.mo-stats { display: flex; flex-wrap: wrap; gap: 0; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 2px; font-size: 14px; color: var(--muted); }
.mo-stats > * { padding: 0 16px; border-inline-start: 1px solid var(--line); } .mo-stats > *:first-child { padding-inline-start: 0; border: 0; }
.mo-stats b { color: var(--text); font-weight: 700; } .mo-stats .linkbtn { color: var(--muted); font-weight: 400; } .mo-stats .linkbtn b { color: var(--teal); }
.mo-warn { color: #b26a00; font-weight: 600; }
.mo-head { display: flex; gap: 16px; align-items: center; }
.mo-thumb { width: 72px; height: 72px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); object-fit: contain; padding: 6px; }
.mo-head h1 { margin: 0; font-size: 28px; line-height: 1.15; }
.mo-prod { font-size: 18px; font-weight: 700; margin-top: 2px; }
.mo-prog { margin-top: 8px; display: grid; gap: 4px; }
.mo-bar { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; } .mo-bar i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.mo-prog small { color: var(--muted); font-size: 12.5px; }
.mo-user { display: flex; align-items: center; gap: 8px; }
.mo-user .who { width: 26px; height: 26px; border-radius: 50%; background: var(--soft); color: var(--muted); display: grid; place-items: center; }
.mo-user .who svg { width: 15px; height: 15px; }
.mo-lines table { min-width: 680px; }
.mo-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; color: #fff; }
.mo-pill.tone-green { background: #2ca01c; } .mo-pill.tone-orange { background: #e8a200; } .mo-pill.tone-red { background: #d93025; }
.mo-pill.tone-teal { background: var(--teal); } .mo-pill.tone-gray { background: #9aa3ad; }
.mo-hint { font-size: 13px; margin: 8px 0 0; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
/* ===== نقاط البيع ===== */
.pos-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pos-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 14px; }
.pos-card-top { display: flex; gap: 12px; align-items: center; } .pos-card-top img { width: 56px; height: 56px; }
.pos-card-top h3 { margin: 0; font-size: 18px; } .pos-card-top p { margin: 2px 0 0; }
.pos-card-s { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pos-card-btns { display: flex; gap: 8px; }
.pos-app { position: fixed; inset: 0; z-index: 40; background: var(--page); display: grid; grid-template-rows: auto 1fr auto; direction: rtl; }
.pos-top { background: var(--sidebar); color: #fff; display: flex; align-items: center; gap: 14px; padding: 10px 18px; }
.pos-brand { display: grid; line-height: 1; } .pos-brand b { color: #7fd36b; font-size: 17px; } .pos-brand span { color: var(--teal-line); font-size: 12px; }
.pos-title { display: grid; } .pos-title b { font-size: 15px; } .pos-title small { color: var(--sidebar-muted); font-size: 12px; }
.pos-chip { background: #45464b; border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--sidebar-muted); } .pos-chip b { color: #fff; }
.pos-search-w { flex: 1; position: relative; max-width: 460px; margin-inline: auto; }
.pos-search { width: 100%; height: 38px; border-radius: 10px; border: 0; padding: 0 38px 0 12px; font: inherit; background: #45464b; color: #fff; outline: none; }
.pos-search::placeholder { color: #a9abb0; } .pos-search:focus { background: #505157; }
.pos-search-ic { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: #a9abb0; } .pos-search-ic svg { width: 100%; height: 100%; }
.pos-user { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pos-user .who, .pos-cust .who { width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--muted); display: grid; place-items: center; } .pos-user .who svg, .pos-cust .who svg { width: 16px; height: 16px; }
.pos-tbtn { height: 34px; border: 1px solid #5a5b60; background: transparent; color: #fff; border-radius: 8px; padding: 0 12px; cursor: pointer; font: inherit; font-size: 13px; }
.pos-tbtn:hover { background: #45464b; } .pos-tbtn.ghost { border-color: transparent; font-size: 16px; }
.pos-body { display: grid; grid-template-columns: minmax(340px, 38%) 1fr; gap: 14px; padding: 14px; min-height: 0; }
.pos-order { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: grid; grid-template-rows: auto 1fr auto auto auto; min-height: 0; overflow: hidden; }
.pos-cust { display: flex; align-items: center; gap: 8px; margin: 12px; justify-self: start; border: 1px solid var(--line); background: var(--soft); border-radius: 10px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13.5px; }
.pos-lines { overflow: auto; border-top: 1px solid var(--line); }
.pos-line { width: 100%; display: grid; grid-template-columns: 26px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--card); text-align: right; cursor: pointer; font: inherit; }
.pos-line .n { color: var(--muted); } .pos-line .nm { font-weight: 600; } .pos-line .qp { color: var(--muted); font-size: 13px; } .pos-line .t { font-variant-numeric: tabular-nums; }
.pos-line.on { background: var(--teal); color: #fff; } .pos-line.on .n, .pos-line.on .qp { color: #e3f5f4; }
.pos-empty { display: grid; place-items: center; text-align: center; color: var(--muted); padding: 40px 20px; gap: 8px; } .pos-empty img { width: 72px; opacity: .8; }
.pos-totals { padding: 10px 16px; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.pos-totals > div { display: flex; justify-content: space-between; } .pos-totals .grand { color: var(--text); font-size: 20px; font-weight: 800; }
.pos-padwrap { display: grid; grid-template-columns: 1fr 120px; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.pos-modes { display: grid; gap: 6px; order: 2; }
.pos-mode { border: 1px solid var(--line); background: var(--card); border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px; }
.pos-mode.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.pos-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; direction: ltr; }
.pos-key { height: 44px; border: 1px solid var(--line); background: var(--soft); border-radius: 8px; font: inherit; font-size: 18px; font-weight: 600; cursor: pointer; }
.pos-key:active { background: var(--teal-soft); }
.pos-pay { margin: 0 12px 12px; height: 54px; border: 0; border-radius: 12px; background: var(--green); color: #fff; font: inherit; font-size: 20px; font-weight: 800; cursor: pointer; box-shadow: 0 6px 16px rgba(44, 160, 28, .25); }
.pos-pay:disabled { opacity: .5; cursor: default; box-shadow: none; }
.pos-catalog { display: grid; grid-template-rows: auto 1fr; gap: 12px; min-height: 0; }
.pos-cats { display: flex; gap: 8px; flex-wrap: wrap; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; overflow: auto; align-content: start; padding-bottom: 8px; }
.pos-prod { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; gap: 4px; justify-items: center; text-align: center; cursor: pointer; font: inherit; transition: transform .12s, box-shadow .12s, border-color .12s; }
.pos-prod:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); border-color: var(--teal-line); }
.pos-thumb { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: var(--teal); }
.pos-prod b { font-size: 14px; line-height: 1.3; } .pos-price { color: var(--green-dark); font-weight: 700; font-size: 14px; }
.pos-stock { font-size: 11.5px; color: var(--muted); } .pos-stock.out { color: var(--danger); }
.pos-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 6px; } .pos-foot a { color: var(--teal); }
.pos-paybox { width: min(860px, 96vw); max-width: none; }
.pos-paygrid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
.pos-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pos-method { height: 54px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); font: inherit; font-weight: 700; cursor: pointer; }
.pos-method:hover { border-color: var(--teal); background: var(--teal-soft); }
.pos-paylist { display: grid; gap: 6px; }
.pos-payrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.pos-payrow.on { border-color: var(--teal); background: var(--teal-soft); } .pos-payrow button { border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--muted); }
.pos-paysum { display: grid; gap: 6px; margin-bottom: 10px; } .pos-paysum > div { display: flex; justify-content: space-between; font-size: 15px; }
.pos-paysum .due b { color: var(--danger); font-size: 20px; } .pos-paysum .chg b { color: var(--green-dark); font-size: 20px; }
.pos-receipt { width: 360px; } .pos-rc { text-align: center; font-size: 14px; } .pos-rc h3 { margin: 0; } .pos-rc p { margin: 2px 0; }
.pos-rc table { width: 100%; margin: 10px 0; border-collapse: collapse; font-size: 13px; } .pos-rc td { padding: 4px 0; border-bottom: 1px dashed var(--line); text-align: right; } .pos-rc td:last-child { text-align: left; }
.pos-rc-t, .pos-rc-p { display: flex; justify-content: space-between; } .pos-rc-t { font-size: 16px; margin: 6px 0; }
.pos-sum { display: grid; gap: 6px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.pos-sum > div { display: flex; justify-content: space-between; } .pos-sum .grand { border-top: 1px solid var(--line); padding-top: 6px; font-size: 16px; }
@media (max-width: 900px) { .pos-body { grid-template-columns: 1fr; overflow: auto; } .pos-paygrid { grid-template-columns: 1fr; } .pos-top { flex-wrap: wrap; } }
@media print { .pos-app { display: none; } }
/* ===== إضافات المشتريات ===== */
.mo-sub { font-size: 15px; margin: 18px 0 8px; }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tx-total { display: flex; justify-content: flex-end; gap: 16px; align-items: baseline; padding: 12px 4px 0; font-size: 15px; color: var(--muted); }
.tx-total b { color: var(--text); font-size: 19px; }
/* ===== إضافات المخزون ===== */
.ov-card { gap: 12px; }
.ov-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ov-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ov-stat { border: 1px solid var(--line); background: var(--soft); border-radius: 10px; padding: 8px 4px; display: grid; gap: 2px; justify-items: center; cursor: pointer; font: inherit; }
.ov-stat b { font-size: 18px; } .ov-stat span { font-size: 11.5px; color: var(--muted); }
.ov-stat:disabled { cursor: default; opacity: .55; } .ov-stat.bad b { color: var(--danger); } .ov-stat.warn b { color: #c77700; }
.ov-stat:not(:disabled):hover { border-color: var(--teal); background: var(--teal-soft); }
.ov-alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff7e6; border: 1px solid #f3d29a; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.rp-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
tr.rp-low td:first-child { box-shadow: inset -3px 0 0 var(--danger); }
.chip-x { border: 0; background: none; cursor: pointer; margin-inline-start: 6px; color: var(--muted); }
/* ===== القوائم المنسدلة بمجموعات (زي أودو) ===== */
.dd-group { padding: 8px 14px 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; border-top: 1px solid var(--line); margin-top: 4px; }
.dd-group:first-child { border-top: 0; margin-top: 0; }
.dd-item.sub { padding-inline-start: 24px; }
.appmenu-link { display: inline-flex; align-items: center; height: 100%; padding: 0 12px; color: inherit; text-decoration: none; font: inherit; }
.appmenu-link:hover { background: rgba(255, 255, 255, .08); }
/* ===== التطبيقات ===== */
.apps-search { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; min-width: 280px; font: inherit; }
.apps-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.apps-sec h2 { font-size: 16px; margin: 18px 0 10px; color: var(--muted); }
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.app-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; gap: 10px 12px; box-shadow: var(--shadow); }
.app-card img { width: 56px; height: 56px; grid-row: span 2; }
.app-card h3 { margin: 0; font-size: 16px; } .app-card p { margin: 3px 0; font-size: 13px; color: var(--muted); }
.app-card.on { border-color: var(--teal-line); } .app-card.soon { opacity: .75; } .app-card.soon img { filter: grayscale(.6); }
.app-act { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
/* ===== الإعدادات العامة ===== */
.gs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.gs-apps { position: sticky; top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; display: grid; gap: 2px; }
.gs-apps a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; }
.gs-apps a img { width: 28px; height: 28px; } .gs-apps a:hover { background: var(--soft); } .gs-apps a.on { background: var(--teal-soft); color: var(--teal); font-weight: 700; }
@media (max-width: 900px) { .gs-layout { grid-template-columns: 1fr; } .gs-apps { position: static; grid-auto-flow: column; overflow-x: auto; } }
/* ===== مصفوفة الصلاحيات ===== */
.perm-matrix { border-collapse: collapse; font-size: 13px; background: var(--card); }
.perm-matrix th, .perm-matrix td { border: 1px solid var(--line); padding: 6px 8px; }
.perm-matrix th { position: sticky; top: 0; background: var(--soft); font-weight: 700; min-width: 90px; } .perm-matrix th small, .perm-matrix td small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.perm-matrix .pm-mod td { background: var(--teal-soft); font-weight: 700; color: var(--teal); }
.perm-matrix .pm-cell { text-align: center; }
/* ===== المستخدم ===== */
.ua-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--soft); color: var(--muted); display: grid; place-items: center; } .ua-avatar svg { width: 30px; height: 30px; }
.ua-name { font: inherit; font-size: 24px; font-weight: 800; border: 0; border-bottom: 1px dashed var(--line); background: transparent; min-width: 300px; }
.ua-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; padding: 12px 0; }
.ua-app { border: 1px solid var(--line); border-radius: 12px; padding: 12px; } .ua-app h4 { margin: 0 0 8px; font-size: 14px; color: var(--teal); }
.ua-g { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 14px; cursor: pointer; }
/* ===== تقارير التحليل (Pivot / Graph) ===== */
.pv-params { align-items: end; }
.pv-mbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0 14px; }
.pv-measures { display: flex; gap: 6px; flex-wrap: wrap; }
.pv-views { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pv-v { border: 0; background: var(--card); padding: 7px 12px; cursor: pointer; font: inherit; font-size: 13px; border-inline-start: 1px solid var(--line); }
.pv-v:first-child { border-inline-start: 0; } .pv-v.on { background: var(--teal); color: #fff; }
table.pv th.pv-rh { text-align: right; font-weight: 600; background: var(--soft); white-space: nowrap; }
table.pv th.pv-ch { text-align: center; background: var(--soft); }
table.pv td.pv-tot, table.pv tfoot td, table.pv tfoot th { font-weight: 800; background: var(--soft); }
table.pv td.pv-zero { color: #c0c6cc; }
.pv-chart { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; } .pv-chart svg { width: 100%; height: auto; font-family: inherit; }
.pv-note { margin: 0 0 8px; font-size: 13px; }
.gs-apps a.sub { padding-inline-start: 26px; font-size: 13px; } .gs-apps a.sub img { width: 20px; height: 20px; opacity: .7; }
.ua-name { display: block; margin-top: 4px; }

/* شاشة الصنف (تبويبات أودو) */
.mf-sec { margin: 10px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted, #6b6c72); border-bottom: 1px solid var(--line, var(--line)); padding-bottom: 4px; }
.mf-note { margin-top: 8px; font-size: 12px; }
.mf-nameline { display: flex; align-items: center; gap: 6px; }
.mf-fav { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: #c9ccd1; padding: 0 2px; }
.mf-fav.on { color: #f5a623; }
.mf-pad textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 6px 8px; border: 1px solid var(--line, var(--line)); border-radius: 4px; }

/* التصدير والاستيراد */
.io-wrap { position: relative; display: inline-block; }
.io-btn { font-size: 18px; color: var(--muted, #6b6c72); }
.io-menu { position: absolute; inset-inline-end: 0; top: 100%; margin-top: 4px; background: var(--card); border: 1px solid var(--line, var(--line)); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); z-index: 40; min-width: 190px; padding: 4px 0; }
.io-menu button { display: block; width: 100%; text-align: start; background: none; border: 0; padding: 8px 14px; font: inherit; cursor: pointer; }
.io-menu button:hover { background: var(--soft); }
.modal.modal-wide { width: min(820px, calc(100vw - 32px)); max-width: 820px; max-height: 88vh; overflow: auto; }
.imp-file { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.imp-map select { width: 100%; }
.imp-ok { color: #1f7a1f; font-weight: 700; margin: 8px 0; }
.imp-warn { color: #a35a00; font-weight: 700; margin: 8px 0; }
.imp-errs { margin: 4px 0; padding-inline-start: 18px; font-size: 13px; color: #b42318; max-height: 180px; overflow: auto; }

/* إعدادات نقطة البيع */
.pc-card .pc-head { display: flex; gap: 12px; align-items: flex-start; }
.pc-card .pc-head p { margin: 4px 0 0; }
.pc-sub { margin-top: 10px; padding-inline-start: 4px; display: grid; gap: 8px; }
.pc-row { display: grid; grid-template-columns: 130px 1fr; gap: 8px; align-items: center; font-size: 13px; }
.pc-row textarea, .pc-row input[type=text], .pc-card select { width: 100%; box-sizing: border-box; font: inherit; }
.pc-multi { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
@media (max-width: 640px) { .pc-row { grid-template-columns: 1fr; } }
.pos-pl { height: 34px; border-radius: 6px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12); color: inherit; padding: 0 8px; font: inherit; }
.pos-pl option { color: var(--text); }
.pos-extra { display: flex; gap: 6px; padding: 6px 10px 0; }
.pos-extra .pos-mode { flex: 1; }
.pos-margin { font-size: 11px; color: var(--muted); }
img.pos-thumb.img { object-fit: cover; }
.pos-card-set { display: inline-block; margin-top: 6px; font-size: 13px; }
.pc-sub[hidden] { display: none; }
.pc-card input[type=text], .pc-card input[type=number], .pc-card select, .pc-card textarea { border: 1px solid var(--line, var(--line)); border-radius: 6px; padding: 6px 8px; min-height: 34px; background: var(--card); }
.pos-order:has(> .pos-extra) { grid-template-rows: auto 1fr auto auto auto auto; }
.pos-extra .pos-mode { min-height: 40px; font-weight: 600; }

/* معاينة المستندات والدورة */
.doc-modal { width: min(980px, calc(100vw - 24px)); height: min(92vh, 1200px); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.doc-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line, var(--line)); }
.doc-frame { flex: 1; width: 100%; border: 0; background: var(--card); }
.st-locked { display: inline-block; padding: 4px 12px; border-radius: 14px; background: var(--soft); color: #3d4b5c; font-weight: 600; font-size: 13px; }
.of-optional { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.opt-chip { cursor: pointer; border: 1px dashed var(--teal, #0D8D8F); background: var(--soft); }
.modal.doc-modal { max-width: none; }

/* ===== شريط النظام: المناقشات والأنشطة والإشعارات ===== */
.tray-w { position: relative; display: inline-flex; }
.tray-n { position: absolute; top: 0; inset-inline-start: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #0D8D8F; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; pointer-events: none; transform: translate(-25%, -15%); }
.tray-n.late { background: #d64545; }
.tray-n[hidden] { display: none; }
.tray-pop { position: absolute; top: calc(100% + 6px); width: 360px; max-height: 480px; overflow: auto; padding: 0; z-index: 60; color: var(--text); text-align: start; }
.tray-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line, var(--line)); position: sticky; top: 0; background: var(--card); }
.tray-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.tray-row:hover { background: var(--soft); }
.tray-row.unread { background: var(--soft); }
.tray-row p { margin: 2px 0; font-size: 12.5px; color: var(--muted); }
.tray-row b { font-size: 13px; }
.tray-ic { width: 28px; height: 28px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; flex: none; font-size: 13px; }
.tray-cnt { display: flex; gap: 6px; margin-inline-start: auto; }
.tray-cnt i { font-style: normal; font-size: 11.5px; padding: 1px 7px; border-radius: 10px; background: var(--soft); }
.tray-cnt i.late { background: #fde8e8; color: #b42318; }
.tray-cnt i.today { background: #fff4e0; color: #a35a00; }
.tray-empty { padding: 18px 14px; text-align: center; }

/* ===== الدردشة تحت المستند ===== */
.chat-w { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line, var(--line)); }
.chatter-sheet { margin-top: 16px; }
.chat-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.chat-tabs button[data-m] { border: 1px solid var(--line, var(--line)); background: var(--card); border-radius: 6px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chat-tabs button[data-m].on { background: #0D8D8F; color: #fff; border-color: #0D8D8F; }
.chat-tabs .follow { margin-inline-start: auto; font-size: 12.5px; }
.chat-tabs .follow.on { color: #1f7a1f; }
.cmp { border: 1px solid var(--line, var(--line)); border-radius: 8px; padding: 8px; background: var(--card); margin-bottom: 8px; }
.cmp-wrap { position: relative; }
.cmp-in { width: 100%; box-sizing: border-box; border: 0; resize: vertical; font: inherit; outline: none; min-height: 44px; }
.cmp-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.cmp-sug { position: absolute; bottom: 100%; inset-inline-start: 0; background: var(--card); border: 1px solid var(--line, var(--line)); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); min-width: 180px; z-index: 30; }
.cmp-sug.hidden { display: none; }
.cmp-opt { padding: 7px 12px; cursor: pointer; }
.cmp-opt.hi, .cmp-opt:hover { background: var(--soft); }
.mention { color: #0D8D8F; font-weight: 700; background: var(--soft); border-radius: 4px; padding: 0 3px; }
.msgs, .ds-msgs { display: grid; gap: 12px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg .who { width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--muted); display: grid; place-items: center; flex: none; }
.msg .who svg { width: 16px; height: 16px; }
.msg-c { min-width: 0; flex: 1; }
.msg-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.msg-b { margin-top: 2px; white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.msg.note .msg-b { background: #fff8e6; border-radius: 6px; padding: 6px 8px; }
.msg.sys .msg-b { color: #3d6b3d; }
.note-tag { font-size: 11px; background: #fff1cc; color: #8a6100; border-radius: 8px; padding: 0 6px; }
.chat-empty { margin: 6px 0; }
.acts { margin: 6px 0 12px; display: grid; gap: 8px; }
.acts-h { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.act { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--soft); border-inline-start: 3px solid #9aa5b1; }
.act.overdue { border-color: #d64545; background: var(--soft); }
.act.today { border-color: #e09a1a; background: #fff8eb; }
.act.planned { border-color: #2f9e44; }
.act-ic { width: 26px; height: 26px; border-radius: 50%; background: var(--card); display: grid; place-items: center; flex: none; }
.act-c { flex: 1; min-width: 0; }
.act-c b { font-size: 13px; display: block; }
.act-btns { display: flex; gap: 8px; }
.linkbtn.danger { color: #b42318; }
.act-form { border: 1px solid var(--line, var(--line)); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: var(--card); }
.act-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.act-grid label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.act-grid .wide { grid-column: 1 / -1; }
.act-grid input, .act-grid select, .act-grid textarea { font: inherit; border: 1px solid var(--line, var(--line)); border-radius: 6px; padding: 6px 8px; }
.act-sec { margin-bottom: 18px; display: grid; gap: 8px; }
.act-sec h3 { margin: 6px 0; font-size: 15px; }
@media (max-width: 640px) { .act-grid { grid-template-columns: 1fr; } .tray-pop { width: calc(100vw - 24px); inset-inline-end: -60px; } }

/* ===== تطبيق المناقشات ===== */
.ds { display: grid; grid-template-columns: 260px 1fr; gap: 16px; height: calc(100vh - 210px); min-height: 460px; }
.ds-side { background: var(--card); border: 1px solid var(--line, var(--line)); border-radius: 14px; padding: 12px; overflow: auto; }
.ds-sec { margin-bottom: 14px; display: grid; gap: 2px; }
.ds-sec-h { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; color: var(--muted); font-size: 12.5px; }
.ds-sec-h .linkbtn { font-size: 18px; line-height: 1; }
.ds-item { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-radius: 8px; padding: 7px 8px; font: inherit; cursor: pointer; text-align: start; }
.ds-item:hover { background: var(--soft); }
.ds-item.on { background: var(--soft); color: #0b6e70; font-weight: 700; }
.ds-item.join { color: var(--muted); }
.ds-item small { margin-inline-start: auto; font-size: 11px; }
.ds-pre { width: 16px; text-align: center; color: #8a96a3; }
.ds-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-badge { background: #0D8D8F; color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.ds-hint { padding: 6px 8px; display: block; }
.ds-main { background: var(--card); border: 1px solid var(--line, var(--line)); border-radius: 14px; display: grid; grid-template-rows: auto 1fr auto; min-height: 0; overflow: hidden; }
.ds-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line, var(--line)); }
.ds-head .btns { margin-inline-start: auto; }
.ds-msgs { overflow: auto; padding: 16px; align-content: start; }
.ds-main > .cmp { margin: 0; border-width: 1px 0 0; border-radius: 0; padding: 10px 16px; }
@media (max-width: 760px) { .ds { grid-template-columns: 1fr; height: auto; } .ds-side { max-height: 240px; } .ds-main { min-height: 70vh; } }
.tray-pop { inset-inline-start: auto; inset-inline-end: -10px; }
@media (max-width: 640px) { .tray-pop { inset-inline-end: -120px; } }
.defer-btn { font-size: 11.5px; padding: 0; }

/* المقاولات */
.con-bar { position: relative; block-size: 18px; min-inline-size: 90px; background: var(--line, #e3e6ea); border-radius: 9px; overflow: hidden; }
.con-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; background: #2ca01c; opacity: .8; }
.con-bar span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 18px; }
.con-sums { margin-block: 12px; margin-inline-start: auto; max-inline-size: 380px; display: grid; gap: 4px; }
.con-sums > div { display: flex; justify-content: space-between; padding: 4px 8px; }
.con-sums > div.tot { border-block-start: 2px solid #2ca01c; font-size: 1.05em; }
.w-s { max-inline-size: 90px; }
.w-n { max-inline-size: 120px; }
td.con-name { min-inline-size: 240px; }
td.con-name input { inline-size: 100%; }

/* نموذج المستند الموحّد */
.doc-banner { margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; background: #fff4e5; color: #8a4b00; border: 1px solid #ffd59e; }
.doc-wide .of { grid-template-columns: 180px 1fr; }
.doc-grid-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.of-ro.pre { white-space: pre-wrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--soft); }

/* شاشة المحافظ */
.wd-kpis { margin-block-end: 14px; }
.wd-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .wd-layout { grid-template-columns: 1fr; } }
.wd-main, .wd-side { padding: 18px; }
.wd-wallets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-block-end: 14px; }
.wd-wallet { display: grid; gap: 4px; text-align: start; padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; font: inherit; }
.wd-wallet.on { border-color: #2ca01c; box-shadow: 0 0 0 3px #2ca01c22; }
.wd-wallet strong { font-size: 1.25em; }
.wd-wallet.prov-vodafone small { color: #e60000; } .wd-wallet.prov-etisalat small { color: #3a7d1e; } .wd-wallet.prov-orange small { color: #ff7900; }
.wd-wallet.prov-we small { color: #5c2d91; } .wd-wallet.prov-instapay small { color: #3b0f6e; } .wd-wallet.prov-fawry small { color: #f5a300; }
.wd-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-block-end: 14px; }
.wd-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.wd-f { display: grid; gap: 4px; } .wd-f span { font-size: .9em; color: var(--muted); }
.wd-amount { font-size: 1.6em; font-weight: 700; }
.wd-sum { display: flex; gap: 12px; align-items: baseline; margin: 14px 0; padding: 12px 14px; background: var(--soft); border-radius: 10px; }
.wd-sum b { font-size: 1.4em; color: #1b7a12; }
.wd-go { inline-size: 100%; padding: 12px; font-size: 1.1em; }
/* ملصقات الأرفف */
.sl-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-block-end: 12px; }
.sl-tools .pk { min-inline-size: 200px; }
.labels-print { display: none; }
@media print {
  body.print-labels > *:not(.labels-print) { display: none !important; }
  body.print-labels .labels-print { display: flex; flex-wrap: wrap; gap: 2mm; direction: rtl; }
  .shelf-label { border: 1px dashed #999; padding: 2mm; break-inside: avoid; display: grid; align-content: space-between; text-align: center; font-family: inherit; }
  .size-small .shelf-label { inline-size: 40mm; block-size: 25mm; font-size: 8pt; }
  .size-medium .shelf-label { inline-size: 60mm; block-size: 35mm; font-size: 10pt; }
  .size-large .shelf-label { inline-size: 90mm; block-size: 50mm; font-size: 13pt; }
  .sl-name { font-weight: 700; overflow: hidden; max-block-size: 2.6em; }
  .sl-price b { font-size: 1.9em; }
  .sl-bc svg { inline-size: 100%; block-size: 9mm; }
  .sl-code { font-size: .8em; letter-spacing: 1px; }
}
/* شاشة المطبخ */
.kds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-block-start: 12px; }
@media (max-width: 900px) { .kds { grid-template-columns: 1fr; } }
.kds-col { background: var(--soft); border-radius: 12px; padding: 10px; min-block-size: 300px; }
.kds-col h3 { margin: 4px 6px 10px; }
.kds-new h3 { color: #1565c0; } .kds-cooking h3 { color: #e65100; } .kds-ready h3 { color: #2e7d32; }
.kds-card { background: var(--card); border-radius: 10px; padding: 10px 12px; margin-block-end: 10px; box-shadow: 0 1px 3px #0001; border-inline-start: 5px solid #90caf9; }
.kds-cooking .kds-card { border-inline-start-color: #ffb74d; } .kds-ready .kds-card { border-inline-start-color: #81c784; }
.kds-card.late { border-inline-start-color: #e53935; background: var(--soft); }
.kds-card header { display: flex; gap: 8px; align-items: baseline; } .kds-card header small { margin-inline-start: auto; color: #777; }
.kds-card ul { margin: 8px 0; padding-inline-start: 18px; } .kds-card li { margin: 3px 0; font-size: 1.05em; } .kds-card em { color: #c62828; font-style: normal; }

/* المطعم في نقطة البيع */
.rt-floor { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; padding: 14px; overflow: auto; }
.rt-floor > .empty { grid-column: 1 / -1; }
.rt-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; margin-block-start: 12px; }
.rt-table { position: relative; aspect-ratio: 1 / 1; display: grid; place-content: center; gap: 4px; text-align: center; border: 2px solid #cfd8dc; background: var(--soft); border-radius: 14px; cursor: pointer; font: inherit; }
.rt-table.round { border-radius: 50%; }
.rt-table b { font-size: 1.3em; }
.rt-table.busy { background: #fff3e0; border-color: #ffb74d; }
.rt-table.ready { border-color: #43a047; box-shadow: 0 0 0 3px #43a04733; }
.rt-badge { position: absolute; inset-block-start: 6px; inset-inline-end: 6px; font-style: normal; font-size: .75em; padding: 2px 6px; border-radius: 8px; background: #ffe0b2; color: #e65100; }
.rt-badge.ok { background: #c8e6c9; color: #1b5e20; }
.rt-side { display: grid; align-content: start; gap: 8px; background: var(--card); border-radius: 12px; padding: 12px; }
.rt-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rt-open { display: flex; justify-content: space-between; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); cursor: pointer; font: inherit; }
.rt-chip b { margin-inline: 2px; } .rt-guests { border: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
.rt-note { color: #c62828; } .rt-sent { color: #2e7d32; }
.pos-body[hidden], .rt-floor[hidden] { display: none !important; }

.wd-f[hidden] { display: none !important; }
.wd-side { overflow-x: auto; min-inline-size: 0; }
.wd-main { min-inline-size: 0; }

.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.seg-b { border: 1px solid #d0d7de; background: var(--card); border-radius: 16px; padding: 3px 12px; cursor: pointer; font: inherit; font-size: .9em; }
.seg-b.on { color: #fff; border-color: transparent; background: #546e7a; }
.seg-b.seg-present.on { background: #2e7d32; } .seg-b.seg-absent.on { background: #c62828; } .seg-b.seg-late.on { background: #ef6c00; } .seg-b.seg-excused.on { background: #1565c0; }

/* ===== التطبيقات المساعدة: المرفقات ولوحة المهام ===== */
.chat-tabs .chat-x { border: 1px solid var(--line, var(--line)); background: var(--card); border-radius: 6px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chat-tabs .chat-x.on { background: var(--soft); border-color: #0D8D8F; color: #0D8D8F; }
.chat-tabs .chat-x.wa { color: #128C4A; }
.att-panel { border: 1px solid var(--line, var(--line)); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: var(--card); }
.att-drop { border: 2px dashed #c9d1d6; border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; font-size: 13px; }
.att-drop.on, .att-drop:focus { border-color: #0D8D8F; background: var(--soft); outline: none; }
.att-drop.big { padding: 40px 16px; display: grid; gap: 8px; justify-items: center; font-size: 15px; }
.att-drop.big img { width: 72px; height: 72px; }
.att-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.att-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.att-list li small { flex: 1; }
.doc-up { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.kb-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.kb-head h1 { margin: 0; font-size: 20px; }
.kb-head select { font: inherit; padding: 7px 10px; border: 1px solid var(--line, var(--line)); border-radius: 8px; min-width: 220px; }
.kb { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kb-col { background: var(--soft); border-radius: 12px; padding: 10px; min-height: 180px; display: grid; gap: 8px; align-content: start; }
.kb-col.over { outline: 2px dashed #0D8D8F; background: var(--soft); }
.kb-col.done .kb-col-h b { color: #15803d; }
.kb-col-h { display: flex; justify-content: space-between; align-items: center; }
.kb-n { background: var(--card); border-radius: 999px; padding: 0 9px; font-size: 12px; color: var(--muted); }
.kb-add { font: inherit; font-size: 13px; border: 1px dashed #c9d1d6; border-radius: 8px; padding: 7px 9px; background: var(--card); }
.kb-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; cursor: grab; display: grid; gap: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.kb-card:hover { border-color: #0D8D8F; }
.kb-card.p2 { border-inline-start: 4px solid #d92d20; } .kb-card.p1 { border-inline-start: 4px solid #f79009; }
.kb-t { font-weight: 600; }
.kb-m { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.kb-m .late, .kb-card.late .kb-m .late { color: #b42318; font-weight: 600; }

/* ===== لوحة القسم: مؤشرات ورسم وقائمة متابعة (زي أودو) ===== */
.dd-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 22px; }
.dd-head .dd-ic { width: 64px; height: 64px; filter: drop-shadow(0 6px 10px rgba(15, 30, 61, .14)); }
.dd-head h1 { margin: 0; font-size: 26px; }
.dd-head p { margin: 4px 0 0; color: var(--muted); }
.dsh { margin-bottom: 28px; display: grid; gap: 18px; }
.dd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.dd-kpi { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 14px; box-shadow: var(--shadow); display: grid; gap: 6px; overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; }
.dd-kpi::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--teal); opacity: .85; }
.dd-kpi.good::before { background: var(--green); } .dd-kpi.warn::before { background: #f59e0b; } .dd-kpi.bad::before { background: var(--danger); }
a.dd-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); border-color: var(--teal-line); }
.dd-l { color: var(--muted); font-size: 13px; }
.dd-v { font-size: 22px; font-weight: 700; direction: ltr; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-v small { font-size: 12px; font-weight: 500; color: var(--muted); }
.dd-kpi.bad .dd-v { color: var(--danger); }
.dd-h { font-size: 12px; color: var(--muted); }
.dd-kpi.sk { height: 86px; background: linear-gradient(90deg, #f3f5f7 25%, #e9edf0 50%, #f3f5f7 75%); background-size: 200% 100%; animation: ddsk 1.2s infinite; }
.dd-kpi.sk::before { display: none; }
@keyframes ddsk { to { background-position: -200% 0; } }
.dd-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
.dd-row.one { grid-template-columns: 1fr; }
.dd-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.dd-pt { font-weight: 700; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dd-pt a { font-weight: 500; font-size: 13px; color: var(--teal); }
.dd-svg { width: 100%; height: auto; display: block; }
.dd-svg .gl { stroke: #eef0f3; } .dd-svg .ax { fill: #8a94a3; font-size: 11px; font-family: inherit; }
.dd-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.dd-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.dd-watch ul { list-style: none; margin: 0; padding: 0; }
.dd-watch li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.dd-watch li:last-child { border-bottom: 0; }
.dd-watch li.clickable { cursor: pointer; border-radius: 8px; } .dd-watch li.clickable:hover { background: var(--soft); }
.dd-watch li b { display: block; font-weight: 600; font-size: 13.5px; }
.dd-watch li small { color: var(--muted); font-size: 12px; }
.dd-watch li.bad small { color: var(--danger); }
.dd-wv { font-weight: 700; direction: ltr; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dd-none { margin: 30px 0; text-align: center; }
.dd-sec { font-size: 16px; color: var(--muted); font-weight: 600; margin: 0 0 14px; }
@media (max-width: 1000px) { .dd-row { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .dd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .dd-v { font-size: 19px; } .dd-head .dd-ic { width: 48px; height: 48px; } }

/* ===== حقوق الوصول بأسلوب أودو ===== */
.ar-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; margin-top: 4px; }
.ar-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; background: var(--card); }
.ar-box h4 { margin: 0 0 4px; font-size: 15.5px; }
.ar-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.ar-row { display: grid; grid-template-columns: 32px minmax(110px, 140px) minmax(0, 230px) 1fr; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.ar-row:last-child { border-bottom: 0; }
.ar-row img { width: 30px; height: 30px; }
.ar-row select { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); width: 100%; }
.ar-row select.lv-on { border-color: var(--teal); background: var(--soft); color: #0b6f71; font-weight: 600; }
.ar-row small { color: var(--muted); font-size: 12px; }
.ex-g { margin-bottom: 10px; } .ex-g h5 { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.ex { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13.5px; cursor: pointer; }
.ovr { font-size: 11px; padding: 1px 8px; border-radius: 99px; color: #8a5a00; }
.ovr:empty { display: none; }
.ovr.deny { background: #fdecea; color: #b42318; } .ovr.allow { background: var(--soft); color: #15803d; }
.hd-row { display: grid; grid-template-columns: minmax(110px, 160px) 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: center; }
.hd-row:last-child { border-bottom: 0; }
.hd-row > div { display: flex; flex-wrap: wrap; gap: 6px; }
.hd { font: inherit; display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 3px 12px; font-size: 12.5px; cursor: pointer; }
.hd.on { background: var(--soft); border-color: #f4c7c0; color: #b42318; }
.hd:disabled { cursor: default; opacity: .85; }
.ar-lock { background: #fff8e6; border: 1px solid #f5dfa6; color: #8a5a00; padding: 10px 14px; border-radius: 10px; margin: 6px 0 14px; font-size: 13.5px; }
@media (max-width: 1000px) { .ar-cols { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .ar-row { grid-template-columns: 28px 1fr; } .ar-row select { grid-column: 1 / -1; } .ar-row small { display: none; } .hd-row { grid-template-columns: 1fr; } }
.ar-top { display: flex; justify-content: flex-end; margin-bottom: 8px; min-height: 4px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.ar-sod { background: #fff4e5; border: 1px solid #f7cf91; color: #7a4a00; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }
.ar-sod ul { margin: 6px 0; padding-inline-start: 18px; } .ar-sod small { color: #8a6a3a; }
.ar-sum summary { cursor: pointer; font-weight: 700; }
.ar-sum[open] summary { margin-bottom: 10px; }
.ar-items { margin: 0; font-size: 13px; color: #374151; line-height: 1.9; }
.ar-hist { list-style: none; margin: 0; padding: 0; } .ar-hist li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; } .ar-hist li:last-child { border-bottom: 0; }
.ar-hist small { color: var(--muted); }
.pl-f { display: grid; gap: 5px; margin-bottom: 12px; font-size: 13.5px; }
.pl-f > span { font-weight: 600; }
.pl-f input, .pl-f textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.pl-f small { color: var(--muted); font-size: 12px; }
.pl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pl-days { display: flex; flex-wrap: wrap; gap: 6px; }
.hd.on2 { background: var(--soft); border-color: var(--teal); color: #0b6f71; font-weight: 600; }
.pl-ro { background: var(--soft); border-radius: 10px; padding: 10px 12px; margin-top: 4px; }

/* ===== الوحدات والعبوات ===== */
.ln-unit { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); max-width: 190px; }
.of-scan-w { margin-inline-start: 14px; }
.of-scan { font: inherit; font-size: 13px; padding: 5px 10px; border: 1px dashed #b9c2c9; border-radius: 8px; width: 190px; background: var(--soft); }
.of-scan:focus { border-style: solid; border-color: var(--teal); outline: none; }
.u-flags { white-space: nowrap; font-size: 12.5px; } .u-flags label { margin-inline-end: 8px; cursor: pointer; }
.u-hint { margin-top: 8px; }
.u-bc { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; } .u-bc input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.u-flags input[type=checkbox], .u-flags input[type=radio] { width: auto !important; height: auto !important; min-width: 0 !important; padding: 0 !important; margin: 0 2px 0 0; vertical-align: middle; accent-color: var(--teal); }
.u-flags label { display: inline-flex; align-items: center; gap: 3px; }
.ln-unit { min-width: 140px; }

/* التقويم الشهري */
.cal-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-bar .btn.on { background: var(--teal, #0d8d8f); color: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line, #e5e7eb); border: 1px solid var(--line, var(--line)); border-radius: 12px; overflow: hidden; }
.cal-dow { background: var(--soft); padding: 8px; font-weight: 600; text-align: center; font-size: 13px; }
.cal-day { background: var(--card); min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.cal-day.out { background: var(--soft); color: #9ca3af; }
.cal-day.today .cal-num { background: var(--teal, #0d8d8f); color: #fff; border-radius: 999px; padding: 0 7px; }
.cal-num { font-size: 12px; align-self: flex-start; }
.cal-ev, .cal-act { display: block; width: 100%; text-align: start; border: 0; border-radius: 6px; padding: 2px 6px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-family: inherit; }
.cal-ev { background: #e0f2f1; color: #0b6f71; }
.cal-act { background: #fff4e5; color: #9a5b00; }
.cal-legend { display: flex; gap: 10px; margin-top: 10px; }
.cal-legend span { width: auto; }
@media (max-width: 700px) { .cal-day { min-height: 70px; } .cal-ev, .cal-act { font-size: 10px; } }

/* الإنشاء السريع من خانة الاختيار */
.pk-list li.pk-create { color: var(--teal, #0d8d8f); font-weight: 600; border-top: 1px solid var(--line, var(--line)); cursor: pointer; }
.pk-list li.pk-create:hover { background: #e0f2f1; }

/* عدّ فئات النقدية عند إقفال الوردية */
.pos-denoms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.pos-denoms.hidden { display: none; }
.pos-denom { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.pos-denom span { min-width: 48px; font-weight: 600; }
.pos-denom input { width: 100%; }

/* اختيارات الكومبو في الكاشير */
.combo-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.combo-choices .chip.on { background: var(--teal, #0d8d8f); color: #fff; border-color: transparent; }
/* الإيصال ومعرض نماذج الطباعة */
.pos-rc-hold { display: flex; justify-content: center; background: var(--soft); border-radius: 10px; max-height: 70vh; overflow: auto; }
.pos-rc-frame { width: 100%; height: 60vh; border: 0; background: var(--soft); }
.logo-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-prev { width: 64px; height: 64px; border-radius: 12px; border: 1px dashed var(--line, var(--line)); display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--card); }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin: 12px 0 26px; }
.pg-card { border: 2px solid var(--line, var(--line)); border-radius: 14px; overflow: hidden; background: var(--card); display: flex; flex-direction: column; }
.pg-card.on { border-color: var(--green, #0D8D8F); box-shadow: 0 0 0 3px rgba(13,141,143,.15); }
.pg-thumb { position: relative; overflow: hidden; background: var(--soft); cursor: zoom-in; }
.pg-thumb iframe { position: absolute; top: 0; right: 0; border: 0; transform-origin: top right; pointer-events: none; background: var(--card); }
.pg-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; gap: 8px; border-top: 1px solid var(--line, var(--line)); }
.pg-foot b { font-size: 15px; }
.pg-badge { font-size: 12px; color: var(--green, #0D8D8F); font-weight: 700; }
.tag-filter { height: 34px; border: 1px solid var(--line, var(--line)); border-radius: 8px; padding: 0 8px; background: var(--card); font: inherit; font-size: 13px; max-width: 170px; }
.pk-short { color: #c2410c; font-weight: 600; } .pk-over { color: #7c3aed; font-weight: 600; }
.ph-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.ph-stat { background: var(--soft, #f4f7f8); border-radius: 10px; padding: 8px 12px; }
.ph-stat span { display: block; font-size: 12px; color: var(--muted, #6b7280); } .ph-stat b { font-size: 15px; }
/* الوضع الليلي: البانر والكروت والعناصر اللي ليها تدرجات فاتحة */
html[data-theme="dark"] .banner { border-color: #2f4a4e;
  background: radial-gradient(420px 180px at 12% 20%, rgba(25, 167, 169, .16), transparent 70%), radial-gradient(600px 240px at 70% 120%, rgba(25, 167, 169, .14), transparent 70%),
    linear-gradient(115deg, #5d6777 0%, #4f6c71 40%, #5f6979 65%, #4d6b6e 100%); box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
html[data-theme="dark"] .banner::before { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent); }
html[data-theme="dark"] .card:hover, html[data-theme="dark"] .card:focus-visible { background: linear-gradient(160deg, #5f7280 0%, #567a80 100%); }
html[data-theme="dark"] .eav { background: linear-gradient(160deg, #6a7584, #606b7a); color: #d3d9e0; }
html[data-theme="dark"] .pr-tile.em { border-color: #2f6b3a; background: linear-gradient(180deg, #23382c, var(--card)); }
html[data-theme="dark"] .dd-kpi.sk { background: linear-gradient(90deg, #66717f 25%, #6e7987 50%, #66717f 75%); background-size: 200% 100%; }

/* الوضع الليلي: الشارات والملاحظات الملونة بدرجات هادئة شفافة */
html[data-theme="dark"] .tone-neutral, html[data-theme="dark"] .tag { background: rgba(255,255,255,.08); color: #c9d1db; }
html[data-theme="dark"] .tone-ok, html[data-theme="dark"] .k-present, html[data-theme="dark"] .tx-chip, html[data-theme="dark"] .close-item.ok .ci-mark { background: rgba(52,181,36,.16); color: #a6ec9b; border-color: rgba(52,181,36,.35); }
html[data-theme="dark"] .tone-draft { background: rgba(255,255,255,.07); color: #b7c0cb; border-color: rgba(255,255,255,.14); }
html[data-theme="dark"] .tone-wait, html[data-theme="dark"] .k-late, html[data-theme="dark"] .je-rev, html[data-theme="dark"] .close-item.warn .ci-mark { background: rgba(227,160,8,.15); color: #f2c35a; border-color: rgba(227,160,8,.35); }
html[data-theme="dark"] .tone-info, html[data-theme="dark"] .k-leave { background: rgba(56,152,214,.16); color: #8cc8f0; border-color: rgba(56,152,214,.35); }
html[data-theme="dark"] .tone-bad, html[data-theme="dark"] .k-absent, html[data-theme="dark"] .st-cancel, html[data-theme="dark"] .close-item.bad .ci-mark { background: rgba(239,107,91,.15); color: #f39a8e; border-color: rgba(239,107,91,.35); }
html[data-theme="dark"] .tone-orange, html[data-theme="dark"] .k-incomplete { background: rgba(239,125,34,.15); color: #f5a964; border-color: rgba(239,125,34,.35); }
html[data-theme="dark"] .set-note, html[data-theme="dark"] .dirty-note { background: rgba(227,160,8,.12); border-color: rgba(227,160,8,.35); color: #f2c35a; }
html[data-theme="dark"] .je-lines tr.je-diff td { background: rgba(239,107,91,.10); }
html[data-theme="dark"] .ecard .code { color: #b7c0cb; }
html[data-theme="dark"] .tone-neutral { color: #c9d1db; }
html[data-theme="dark"] .stepper li.done { background: rgba(25,167,169,.18); color: #8ce6e8; }
html[data-theme="dark"] .icon-btn { color: #b8c1cc; }
html[data-theme="dark"] .banner p { color: #a9b4c0; }
html[data-theme="dark"] tbody tr:hover td, html[data-theme="dark"] a.dd-item:hover, html[data-theme="dark"] a.dd-item:focus-visible { color: #e8fbfb; }
html[data-theme="dark"] .tag.fp, html[data-theme="dark"] .set-index a.on, html[data-theme="dark"] .ds-item.on, html[data-theme="dark"] .ar-row select.lv-on, html[data-theme="dark"] .hd.on2, html[data-theme="dark"] .cal-ev { color: #8ce6e8; }
html[data-theme="dark"] .cal-ev { background: rgba(25,167,169,.18); }
html[data-theme="dark"] .pk-ok, html[data-theme="dark"] .pr-tile.em b, html[data-theme="dark"] .save-state.ok, html[data-theme="dark"] .save-msg.ok, html[data-theme="dark"] .imp-ok, html[data-theme="dark"] .chat-tabs .follow.on, html[data-theme="dark"] .ovr.allow, html[data-theme="dark"] .wd-sum b, html[data-theme="dark"] .kb-col.done .kb-col-h b { color: #a6ec9b; }
html[data-theme="dark"] .pk-part { color: #f2c35a; } html[data-theme="dark"] .save-msg.bad { color: #f39a8e; }
html[data-theme="dark"] .st-locked, html[data-theme="dark"] .ar-items, html[data-theme="dark"] .msg.sys .msg-b { color: #c9d1db; }
html[data-theme="dark"] .ovr.deny { background: rgba(239,107,91,.15); color: #f39a8e; }
html[data-theme="dark"] .rt-badge.ok { background: rgba(52,181,36,.18); color: #a6ec9b; }
html[data-theme="dark"] .mention, html[data-theme="dark"] .chat-tabs .chat-x.on { color: #3cc5c7; }
html[data-theme="dark"] .pk-short { color: #f5a964; } html[data-theme="dark"] .pk-over { color: #b9a3f5; }

/* ===== مطابقة كشف البنك والدفعات المجمّعة ===== */
.st-draft, .st-posted, .st-partial { display: inline-block; font-weight: 700; font-size: 12.5px; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.st-draft { background: #fff4e5; color: #9a5b00; }
.st-partial { background: #eef4ff; color: #1d4ed8; }
.st-posted { background: #e6f6f1; color: #0b7a5c; }
table.bank-rec tr.matched td { color: var(--muted); }
table.bank-rec td:last-child { text-align: end; }
table.rep tr.best td { background: rgba(13, 141, 143, .08); }
.imp-prev .rep-cards { margin: 6px 0 10px; }
.batch-list { min-width: min(640px, 80vw); }
.modal .rep td input[type="checkbox"], .modal .rep th input[type="checkbox"] { width: 17px; height: 17px; }
html[data-theme="dark"] .st-draft { background: rgba(255, 176, 64, .16); color: #ffcf8a; }
html[data-theme="dark"] .st-partial { background: rgba(96, 150, 255, .16); color: #a9c4ff; }
html[data-theme="dark"] .st-posted { background: rgba(63, 208, 160, .16); color: #8fe6c6; }
html[data-theme="dark"] table.rep tr.best td { background: rgba(63, 208, 210, .12); }

/* ===== التتبع من القوائم والمطابقة اليدوية ===== */
table.rep tr.drill { cursor: pointer; }
table.rep tr.drill:hover td { background: rgba(13, 141, 143, .07); }
.rec-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 10px 0; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; position: sticky; top: 0; z-index: 2; }
.rec-bar .btn { margin-inline-start: auto; }
.rec-bar .btn + .btn { margin-inline-start: 0; }
.pay-wo { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 8px; }
html[data-theme="dark"] table.rep tr.drill:hover td { background: rgba(63, 208, 210, .1); }

/* ===== التحديد المتعدد في القوائم ===== */
.sel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; background: var(--card); border: 1px solid var(--teal, #0d8d8f); border-radius: 12px; }
.sel-bar b { margin-inline-end: 6px; }
th.sel-col, td.sel-col { width: 34px; text-align: center; }
td.sel-col input, th.sel-col input { width: 16px; height: 16px; cursor: pointer; }
tr.picked td { background: rgba(13, 141, 143, .07); }
html[data-theme="dark"] tr.picked td { background: rgba(63, 208, 210, .12); }
.sel-bar[hidden], .pay-wo[hidden] { display: none !important; }
.ob-table input{width:100%;box-sizing:border-box;padding:7px 9px;border:1px solid #d5dde3;border-radius:8px;font:inherit;background:transparent;color:inherit}.ob-table td{padding:6px 8px}
.fin-rep .fr-bold td{font-weight:700}.fin-rep .fr-title td{font-weight:700;background:var(--soft,#f3f6f7)}.fr-edit select{padding:6px;border:1px solid #d5dde3;border-radius:8px;font:inherit;background:transparent;color:inherit}.fr-chk{white-space:nowrap;font-size:13px}.fr-mv{white-space:nowrap}
.ob-table input[type=checkbox]{width:auto;padding:0;margin-inline-end:4px}.fr-chk{display:inline-flex;align-items:center;gap:2px}
.bc-bar{margin:8px 0}.bc-input{width:100%;box-sizing:border-box;font-size:22px;padding:14px 16px;border:2px solid #0d8d8f;border-radius:12px;background:transparent;color:inherit}
.bc-msg{min-height:28px;margin:8px 0;font-weight:700}.bc-msg.ok{color:#1c7c3a}.bc-msg.bad{color:#b42318}
.bc-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px}.bc-pick{display:flex;flex-direction:column;gap:4px;text-align:start;padding:14px;border:1px solid #d5dde3;border-radius:12px;background:transparent;color:inherit;cursor:pointer;font:inherit}
.bc-pick:hover{border-color:#0d8d8f}.bc-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:10px 0;flex-wrap:wrap}
tr.bc-full td{background:rgba(28,124,58,.08)}tr.bc-part td{background:rgba(234,170,0,.08)}
.bc-acts{white-space:nowrap}.bc-acts .linkbtn+.linkbtn{margin-inline-start:12px}
.mp{position:relative;display:inline-block;min-width:170px}.mp-btn{width:100%;text-align:start;padding:9px 12px;border:1px solid var(--line,#d9dee2);border-radius:10px;background:var(--card,#fff);cursor:pointer;font:inherit}
.mp-pop{position:absolute;z-index:40;inset-inline-start:0;top:calc(100% + 4px);min-width:240px;max-height:300px;overflow:auto;background:var(--card,#fff);border:1px solid var(--line,#d9dee2);border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.12);padding:6px}
.mp-item{display:flex;gap:8px;align-items:center;padding:6px 8px;border-radius:8px;cursor:pointer}.mp-item:hover{background:rgba(13,141,143,.07)}.mp-tools{display:flex;gap:14px;padding:4px 8px 8px;font-size:12px}
th.fc,td.fc{background:rgba(13,141,143,.07)}th.fc{color:#0d8d8f}
.ex-group{margin-bottom:22px}.ex-formula{font-size:11px;color:var(--muted,#6b7280);margin-top:2px}.ex-arrow.good{color:#15803d}.ex-arrow.bad{color:#b91c1c}
.ex-guide{margin-top:12px;background:var(--card,#fff);border:1px solid var(--line,#e5e7eb);border-radius:12px;padding:12px 16px}.ex-guide summary{cursor:pointer;font-weight:700}
.mp-item input{width:16px!important;height:16px!important;min-height:0!important;margin:0;padding:0;flex:none}.mp-item span{flex:1;white-space:normal;line-height:1.4}
.mp-pop .mp-item{display:flex!important;flex-direction:row!important;justify-content:flex-start;align-items:center;gap:10px}.mp-pop .mp-item span{white-space:nowrap;text-align:start}
.rp-check{flex-direction:row!important;align-items:center;gap:8px;align-self:end;padding-bottom:10px}.rp-check input{width:16px!important;height:16px!important;min-height:0!important}
.rp-check{justify-content:flex-start!important;display:flex!important}.mp-pop .mp-item span{flex:0 1 auto}

/* ===== هيدر وفوتر بصور Gemini (نفس تصميم النظام، تحسين الهيدر والفوتر فقط) ===== */
.ghead { position: relative; overflow: hidden; border-radius: 18px; border: 1px solid #cfe9e4; margin: 4px 0 22px; min-height: 200px;
  background: url(/web/img/header-art.webp) left center / auto 100% no-repeat, #b7eae3;
  box-shadow: 0 6px 24px rgba(13, 141, 143, .10); display: flex; flex-direction: column; justify-content: center; padding: 28px 32px 22px; }
.ghead h1 { margin: 0; font-size: 30px; font-weight: 800; color: #12303d; }
.ghead p { margin: 6px 0 0; color: #45606a; font-size: 15px; max-width: 54%; }
.gtabs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 18px; padding: 4px; background: rgba(255, 255, 255, .78); border: 1px solid rgba(15, 42, 58, .06);
  border-radius: 999px; width: fit-content; max-width: 60%; backdrop-filter: blur(4px); box-shadow: 0 1px 2px rgba(15, 42, 58, .05); }
.gtabs button { border: 0; background: transparent; height: 34px; padding: 0 18px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; color: #4c5f69; cursor: pointer; white-space: nowrap; }
.gtabs button:hover { color: #0d8d8f; }
.gtabs button.on { background: #12917f; color: #fff; box-shadow: 0 2px 6px rgba(18, 145, 127, .35); }
html[data-theme="dark"] .ghead { border-color: #6d8791; }
html[data-theme="dark"] .ghead h1 { color: #12303d; } html[data-theme="dark"] .ghead p { color: #45606a; }
.footer { background: url(/web/img/footer-l.webp) left bottom / auto 100% no-repeat, url(/web/img/footer-r.webp) right bottom / auto 100% no-repeat,
  linear-gradient(90deg, #e5f6f0 0%, #e2f5ef 15%, #cdefe8 60%, #bcece4 85%, #b6ebe3 100%); border-top: 1px solid #cfe9e4; min-height: 84px; color: #3f5862; }
.footer .brand { color: #12303d; font-weight: 700; } .footer a { color: #0d8d8f; font-weight: 600; }
@media (max-width: 720px) { .ghead { background-size: auto 60%, auto; background-position: left bottom, 0 0; padding: 20px 18px 110px; } .ghead p, .gtabs { max-width: 100%; } }
.dd-sec{scroll-margin-top:130px}
.gbox{margin-bottom:24px}
.nav a { padding: 8px 16px 8px 14px; gap: 12px; }
.nav-ic { width: 38px; height: 38px; object-fit: contain; flex: none; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .25)); }
.nav-t { flex: 1; min-width: 0; }
.nav-caret { flex: none; width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--sidebar-muted); font-size: 18px; line-height: 1; cursor: pointer; transition: transform .2s, background .15s; }
.nav-caret:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-caret.open { transform: rotate(-90deg); }
.nav .sub a { padding: 8px 64px 8px 18px; }
.grid.sortable > .card { cursor: grab; }
.grid.sortable > .card.dragging { opacity: .45; transform: scale(.97); cursor: grabbing; }
/* قائمة جانبية أكبر */
.nav a { padding: 12px 18px 12px 14px; font-size: 15.5px; gap: 14px; }
.nav-ic { width: 48px; height: 48px; }
.nav .sub a { font-size: 14px; padding: 9px 76px 9px 18px; }
.nav li[draggable=true] > a { cursor: grab; } .nav li.dragging { opacity: .45; }
.nav li[draggable=true] > a { cursor: grab; } .nav li.dragging { opacity: .45; } .wordmark { margin-bottom: 14px; }
