/* ============================================================
   طبقة التصميم الجديدة — Executive Light + هوية العلامة
   تُحمّل بعد styles.css وتعيد تنسيق القشرة والمكوّنات
   ============================================================ */

:root{
  --primary:#2f6b3a; --primary-light:#3f8249; --accent:#d99a2b;
  --bg:#f5f6f0; --card:#fffdf8; --border:#e4e8dd; --danger:#c0392b;
  --text:#20271b; --muted:#6f7a63; --info:#1f6f8b;
  --radius:14px; --shadow:0 1px 2px rgba(28,40,20,.04),0 14px 30px -24px rgba(28,40,20,.45);
  --line:#e6e9e0; --side:#fffefb;
  --font:"IBM Plex Sans Arabic","Noto Kufi Arabic","Tajawal","Segoe UI",Tahoma,sans-serif;
}

body{
  font-family:var(--font); padding:0; color:var(--text);
  background:
    radial-gradient(900px 420px at 100% -10%,rgba(122,163,60,.10),transparent 60%),
    radial-gradient(700px 380px at 0% 110%,rgba(217,154,43,.07),transparent 60%),
    var(--bg);
}

/* ---------------- الأيقونات (SVG masks) ---------------- */
.ico{
  display:inline-block;width:18px;height:18px;flex:0 0 auto;background:currentColor;
  -webkit-mask:var(--i) center/contain no-repeat;mask:var(--i) center/contain no-repeat;
}
.btn .ico{width:15px;height:15px}
[data-ico="dashboard"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='2'/%3E%3Crect x='14' y='3' width='7' height='7' rx='2'/%3E%3Crect x='3' y='14' width='7' height='7' rx='2'/%3E%3Crect x='14' y='14' width='7' height='7' rx='2'/%3E%3C/svg%3E")}
[data-ico="branch"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18'/%3E%3Cpath d='M5 21V7l7-4 7 4v14'/%3E%3Cpath d='M9 21v-6h6v6'/%3E%3C/svg%3E")}
[data-ico="box"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8l-9-5-9 5 9 5 9-5Z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8'/%3E%3Cpath d='M12 13v8'/%3E%3C/svg%3E")}
[data-ico="truck"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h11v9H3z'/%3E%3Cpath d='M14 10h4l3 3v3h-7z'/%3E%3Ccircle cx='7' cy='18' r='1.6'/%3E%3Ccircle cx='17.5' cy='18' r='1.6'/%3E%3C/svg%3E")}
[data-ico="inbox"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v11'/%3E%3Cpath d='m8 10 4 4 4-4'/%3E%3Cpath d='M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2'/%3E%3C/svg%3E")}
[data-ico="file"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'/%3E%3Cpath d='M14 3v6h6'/%3E%3Cpath d='M8 13h8M8 17h5'/%3E%3C/svg%3E")}
[data-ico="users"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3C/svg%3E")}
[data-ico="history"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M3.05 13A9 9 0 1 0 6 5.3L3 8'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E")}
[data-ico="plus"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E")}
[data-ico="list"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E")}
[data-ico="edit"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E")}
[data-ico="refresh"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-2.6-6.4'/%3E%3Cpath d='M21 3v6h-6'/%3E%3C/svg%3E")}
[data-ico="lock"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='10' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E")}
[data-ico="print"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9V3h12v6'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect x='6' y='14' width='12' height='8'/%3E%3C/svg%3E")}
[data-ico="wallet"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='18' height='13' rx='3'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M16.5 14.5h.01'/%3E%3C/svg%3E")}
[data-ico="calendar"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3 11h18'/%3E%3C/svg%3E")}
[data-ico="hourglass"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2h12M6 22h12'/%3E%3Cpath d='M8 2v4a4 4 0 0 0 8 0V2'/%3E%3Cpath d='M8 22v-4a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E")}
[data-ico="ban"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M5.6 5.6l12.8 12.8'/%3E%3C/svg%3E")}
[data-ico="check"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")}
[data-ico="more"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Ccircle cx='5' cy='12' r='1.6'/%3E%3Ccircle cx='12' cy='12' r='1.6'/%3E%3Ccircle cx='19' cy='12' r='1.6'/%3E%3C/svg%3E")}
[data-ico="logout"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='M16 17l5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E")}
[data-ico="warning"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z'/%3E%3C/svg%3E")}
[data-ico="trash"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M6 6l1 14h10l1-14'/%3E%3Cpath d='M10 11v5M14 11v5'/%3E%3C/svg%3E")}
[data-ico="download"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 11 5 5 5-5'/%3E%3Cpath d='M4 20h16'/%3E%3C/svg%3E")}
[data-ico="upload"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20V8'/%3E%3Cpath d='m7 12 5-5 5 5'/%3E%3Cpath d='M4 4h16'/%3E%3C/svg%3E")}
[data-ico="phone"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 3h3l1.5 4-2 1.5a12 12 0 0 0 5 5L15.5 11l4 1.5v3a2 2 0 0 1-2.2 2A16.5 16.5 0 0 1 4.5 5.2 2 2 0 0 1 6.5 3Z'/%3E%3C/svg%3E")}
[data-ico="bolt"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 4 14h6l-1 8 9-12h-6l1-8Z'/%3E%3C/svg%3E")}
[data-ico="archive"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='4' rx='1'/%3E%3Cpath d='M5 8v11a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8'/%3E%3Cpath d='M10 12h4'/%3E%3C/svg%3E")}
[data-ico="undo"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h9a6 6 0 0 1 0 12h-3'/%3E%3C/svg%3E")}

/* ---------------- القشرة ---------------- */
#appShell{display:grid;grid-template-columns:252px minmax(0,1fr);min-height:100vh;align-items:stretch}
.sidebar{
  position:sticky;top:0;height:100vh;display:flex;flex-direction:column;gap:16px;
  padding:18px 13px;background:var(--side);border-inline-end:1px solid var(--line);z-index:40;
}
.brand{display:flex;align-items:center;gap:11px;padding:2px 4px 15px;border-bottom:1px solid var(--line)}
.logo3d{
  width:42px;height:42px;border-radius:13px;display:grid;place-items:center;color:#fff;
  background:linear-gradient(145deg,#4d9157,#2a5f34);
  box-shadow:0 10px 20px -10px rgba(47,107,58,.8),inset 0 1px 0 rgba(255,255,255,.35);
  position:relative;flex:0 0 auto;
}
.logo3d svg{width:21px;height:21px}
.brand b{display:block;font-size:13px;font-weight:800;line-height:1.45;letter-spacing:-.01em}
.brand small{display:block;font-size:9.8px;color:var(--muted);margin-top:2px}

.sidebar .tabs{
  display:flex;flex-direction:column;gap:3px;padding:0;border:0;background:none;
  overflow:visible;flex-wrap:nowrap;
}
.tab{
  position:relative;display:flex;align-items:center;gap:10px;padding:10px 11px;
  border:0;border-bottom:0;border-radius:11px;background:transparent;color:var(--muted);
  font-size:12.6px;font-weight:600;cursor:pointer;transition:.16s;white-space:nowrap;text-align:start;
}
.tab:hover{background:#f2f5ea;color:var(--text)}
.tab.active{background:#eef3dd;color:var(--primary);box-shadow:inset 0 0 0 1px #dfe8c9}
.tab .ico{width:18px;height:18px;opacity:.92}
.tab .dot{
  margin-inline-start:auto;width:7px;height:7px;border-radius:50%;
  background:var(--accent);display:none;box-shadow:0 0 0 3px rgba(217,154,43,.18);
}
.tab.has-pending .dot{display:inline-block}

.side-foot{
  margin-top:auto;display:flex;flex-direction:column;gap:7px;padding:11px 12px;
  border:1px solid var(--line);border-radius:12px;background:#fbfaf2;font-size:10px;color:var(--muted);
}
.side-foot .row{display:flex;align-items:center;gap:7px}
.side-foot b{color:var(--text);font-weight:700}
.dot-on{width:7px;height:7px;border-radius:50%;background:#3fa96b;box-shadow:0 0 0 3px rgba(63,169,107,.16);flex:0 0 auto}

.workspace{display:flex;flex-direction:column;min-width:0;min-height:100vh}

header.topbar{
  position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:9px;flex-wrap:nowrap;
  padding:11px 20px;background:rgba(255,253,248,.86);backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);border-bottom:1px solid var(--line);color:var(--text);
  box-shadow:none;
}
.mobile-brand{display:none;align-items:center;gap:8px;min-width:0}
.mobile-brand .logo3d{width:33px;height:33px;border-radius:10px}
.mobile-brand .logo3d svg{width:17px;height:17px}
.mobile-brand b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}
.top-spacer{flex:1}

.branch-picker{display:flex;align-items:center;gap:7px;font-size:11.5px;color:var(--muted);min-width:0}
.branch-picker select{
  width:auto;min-width:132px;padding:8px 26px 8px 10px;border:1px solid var(--line);border-radius:10px;
  background:#fff;color:var(--text);font-weight:700;font-size:12px;
}
.branch-picker select:focus{border-color:#9dbb74;box-shadow:0 0 0 3px rgba(122,163,60,.16)}

.user-chip{
  display:flex;align-items:center;gap:9px;background:#f4f6ec;border:1px solid var(--line);
  border-radius:12px;padding:5px 10px 5px 6px;
}
.user-chip .name{font-size:11.5px;font-weight:700;color:var(--text);line-height:1.35}
.user-chip .role{font-size:9.5px;color:var(--muted)}
.avatar{
  width:31px;height:31px;border-radius:10px;background:linear-gradient(145deg,#4d9157,#2a5f34);
  color:#fff;display:grid;place-items:center;font-weight:800;font-size:12px;flex:0 0 auto;
}
.icon-btn{
  width:36px;height:36px;border:1px solid var(--line);border-radius:11px;background:#fff;
  color:var(--muted);display:grid;place-items:center;cursor:pointer;transition:.16s;padding:0;
}
.icon-btn:hover{background:#f3f6ec;color:var(--primary)}
.icon-btn .ico{width:17px;height:17px}

.container{padding:20px 22px 34px;max-width:1320px;margin:0 auto;width:100%}
.screen{animation:fade .22s}

/* ---------------- البطاقات والعناوين ---------------- */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:16px;margin-bottom:14px;box-shadow:var(--shadow)}
.card h3{color:var(--text);font-size:14px;font-weight:800;margin-bottom:12px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.card h3 .ico{width:18px;height:18px;color:var(--primary)}
.card h3 .hint{font-size:10.5px;font-weight:500;color:var(--muted)}
.locked-banner{
  background:#fdf7e6;border:1px solid #f0dfae;color:#7a5b00;border-radius:11px;
  padding:10px 13px;font-size:12.5px;font-weight:700;display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-bottom:12px;
}
.locked-banner .ico{width:16px;height:16px}
.empty{color:var(--muted);padding:26px;font-style:normal}

/* ---------------- الأزرار ---------------- */
.btn{
  border-radius:11px;padding:9px 15px;font-size:13px;font-weight:700;gap:7px;
  border:1px solid transparent;background:#edf1e5;color:var(--text);transition:.16s;
}
.btn:hover{transform:translateY(-1px);box-shadow:0 10px 20px -16px rgba(28,40,20,.7)}
.btn:active{transform:none}
.btn-primary{background:linear-gradient(135deg,#478a51,#2a5f34);color:#fff}
.btn-solid{background:linear-gradient(135deg,#478a51,#2a5f34);color:#fff;box-shadow:0 10px 22px -15px rgba(47,107,58,.9)}
.btn-green{background:#fff;color:var(--primary);border:1px solid #d6e2c7}
.btn-ghost-dark{background:#fff;color:var(--primary);border:1px solid #cfdcc2}
.btn-danger{background:#b8332a;color:#fff}
.btn-print{background:#1f6f8b;color:#fff}
.btn-wa{background:#25d366;color:#fff}
.btn-sm{padding:5px 10px;font-size:11.5px;border-radius:8px}

/* ---------------- الحقول ---------------- */
input,select,textarea{
  padding:10px 12px;border:1px solid var(--line);border-radius:11px;font-size:13.5px;
  background:#fff;color:var(--text);transition:.16s;font-family:inherit;
}
input:focus,select:focus,textarea:focus{border-color:#9dbb74;box-shadow:0 0 0 3px rgba(122,163,60,.16);outline:none}
label{font-size:11.5px;font-weight:700;color:var(--muted);margin-bottom:6px}
input[disabled],select[disabled]{background:#f3f4ed;color:#96a08b}

/* ---------------- الجداول ---------------- */
table{width:100%;border-collapse:collapse;font-size:12.8px}
th,td{border:0;border-bottom:1px solid var(--line);padding:9px 11px;text-align:start;vertical-align:middle}
th{background:#f4f6ec;color:#53604a;font-weight:700;font-size:11.2px;white-space:nowrap}
tbody tr:nth-child(even){background:#fbfcf6}
tbody tr:hover{background:#f2f6e9}
.table-wrap{border:1px solid var(--line);border-radius:12px;overflow:auto}
.table-wrap table{border:none}
.table-wrap tbody tr:last-child td{border-bottom:none}
.num-cell{text-align:left;direction:ltr;font-variant-numeric:tabular-nums}
.total-row{background:#fbf4e2!important;font-weight:800}
.mono{font-family:Consolas,"Courier New",monospace;font-size:11px;direction:ltr;text-align:left}
.diff-key{font-size:10.5px;color:var(--muted)}

/* ---------------- جدول الاستلام ---------------- */
.receipt-wrap{border:1px solid var(--line);border-radius:12px;overflow:auto;max-height:70vh;position:relative}
.receipt-table{font-size:12px;border-collapse:separate;border-spacing:0}
.receipt-table th,.receipt-table td{border:1px solid var(--line);padding:3px}
.receipt-table th{position:sticky;top:0;z-index:3;background:#eef2e4;color:#44523c;font-size:11.2px;padding:6px 4px}
.receipt-table thead tr:first-child th{top:0}
.receipt-table thead tr:nth-child(2) th{top:33px}
.receipt-table th.corner,.receipt-table td.date-cell{position:sticky;right:0;z-index:2}
.receipt-table th.corner{background:#e3ebd3;color:#33402c;z-index:4}
.receipt-table td.date-cell{background:#f6f8ef;font-weight:800;font-size:11px;white-space:nowrap;min-width:78px}
.receipt-table td.total-cell{background:#fbf4e2;font-weight:800;color:#8a5a12;min-width:70px;font-variant-numeric:tabular-nums}
.receipt-table input{padding:5px 2px;font-size:12px;text-align:center;border-radius:6px;min-width:52px;border:1px solid #e6eadf;font-variant-numeric:tabular-nums}
.receipt-table input:disabled{background:#f2f4ea}
.receipt-table input.filled{background:#f4f9ec;border-color:#c8dcae}
.receipt-table .row-actions{position:sticky;left:0;background:#fff;z-index:2;border-left:1px solid var(--line)}
.receipt-table tr:hover td{background:#f6f9ef}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:11px;color:var(--muted);margin-top:8px}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend span::before{content:"";width:6px;height:6px;border-radius:50%;background:#a9c07a;flex:0 0 auto}

/* ---------------- التقرير ---------------- */
.report-paper{background:#fff;padding:24px;border-radius:14px;border:1px solid var(--line);max-width:980px;margin:auto;box-shadow:var(--shadow)}
.report-head{text-align:center;border-bottom:2px solid #c9d6b8;padding-bottom:14px;margin-bottom:18px}
.report-head h2{color:var(--primary);font-size:20px}
.report-head p{font-size:12px;color:var(--muted);margin-top:4px}
.report-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px 18px;font-size:12px;margin-bottom:14px}
.report-paper table{font-size:12px}
.report-foot{display:flex;justify-content:space-between;margin-top:32px;font-size:12px;flex-wrap:wrap;gap:14px}
.sign-line{border-top:1px dashed #95a086;width:190px;padding-top:6px;text-align:center}

/* ---------------- لوحة المالك ---------------- */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;margin-bottom:14px}
.stat-card{position:relative;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:15px;box-shadow:var(--shadow)}
.stat-card .label{font-size:10.8px;color:var(--muted);font-weight:700;display:block;padding-inline-end:50px;line-height:1.6}
.stat-card .value{font-size:22px;font-weight:800;color:var(--text);margin-top:6px;font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.stat-card .foot{font-size:10.3px;color:var(--muted);margin-top:5px;line-height:1.6}
.stat-card.gold .value{color:#a87200}
.stat-card .ico-tile{
  position:absolute;inset-inline-end:14px;top:14px;width:38px;height:38px;border-radius:12px;
  display:grid;place-items:center;background:linear-gradient(150deg,#eff4e3,#e2ecd0);color:var(--primary);
  box-shadow:inset 0 1px 0 #fff,0 8px 16px -12px rgba(47,107,58,.55);
}
.stat-card .ico-tile .ico{width:19px;height:19px}
.stat-card.gold .ico-tile{background:linear-gradient(150deg,#fbf1da,#f3e4c2);color:#a87200}

/* ---------------- عناصر النماذج ---------------- */
.badge{background:#eef3dd;color:#3a6b34;padding:3px 9px;border-radius:999px;font-size:10.8px;font-weight:800}
.badge.warn{background:#fdf3da;color:#8a6512}
.badge.danger{background:#fbe9e6;color:#a02a1e}
.badge.muted{background:#eef0e7;color:#66705c}
.badge.info{background:#e6f1f5;color:#1a6076}
.check-box{background:#fbfcf6;border:1px solid var(--line);border-radius:11px;padding:8px;min-height:44px;display:flex;flex-wrap:wrap;gap:8px}
.check-pill{background:#fff;border:1px solid var(--line);border-radius:999px;padding:5px 11px;font-size:12px;font-weight:600}
.check-pill:has(input:checked){background:#eef3dd;border-color:#9dbb74;color:var(--primary)}
.check-pill input{accent-color:var(--primary)}
.opt-row{background:#fbfcf6;border:1px solid var(--line);border-radius:10px}
.opt-row input{accent-color:var(--primary)}

/* ---------------- المودال والتنبيهات ---------------- */
.modal-overlay{background:rgba(24,32,20,.45);backdrop-filter:blur(4px)}
.modal{border-radius:18px;padding:22px;border:1px solid #fff;box-shadow:0 30px 70px -30px rgba(20,30,15,.65)}
.modal h3{color:var(--text);font-size:16px}
.print-opt{border:2px solid var(--line);border-radius:13px;background:#fff}
.print-opt:hover{border-color:#9dbb74;background:#fbfcf6}
.print-opt.selected{border-color:var(--primary);background:#f0f5e4;box-shadow:0 0 0 3px rgba(122,163,60,.14)}
.print-opt .title{color:var(--primary)}
.print-opt .icon{font-size:0;line-height:0}
.print-opt .icon .ico{width:26px;height:26px;color:var(--primary);display:inline-block;margin-bottom:0}
.more-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.more-item{
  display:flex;align-items:center;gap:9px;padding:12px;border:1px solid var(--line);border-radius:12px;
  background:#fff;color:var(--text);font-family:inherit;font-size:12.5px;font-weight:600;cursor:pointer;
}
.more-item:hover{background:#f3f6ea;border-color:#d9e3c9}
.more-item .ico{width:18px;height:18px;color:var(--primary)}
.conn-bar{background:#fdf6e3;color:#7a5b00;border-bottom:1px solid #f0dfae;font-size:11.5px}
.conn-bar .ico{width:14px;height:14px;vertical-align:-3px}
.conn-bar.offline{background:#fbe9e6;color:#a02a1e;border-color:#f0d3cd}
.toast{background:#26302a;border-radius:12px;font-size:12.5px;padding:11px 18px;box-shadow:0 16px 36px -18px rgba(0,0,0,.5)}
.toast.err{background:#a02a1e}
.toast.ok{background:#2f6b3a}

/* ---------------- شاشة الدخول ---------------- */
.auth-shell{
  position:relative;display:grid;grid-template-columns:minmax(0,1fr) 440px;gap:40px;
  align-items:center;justify-content:center;min-height:100vh;padding:32px max(20px,5vw);
  background:transparent;overflow:hidden;
}
.auth-shell.hidden{display:none!important}
#statusShell{grid-template-columns:1fr;place-items:center}
#statusShell .auth-card{max-width:470px}

.aurora{position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden}
.aurora i{position:absolute;width:46vw;height:46vw;border-radius:50%;filter:blur(70px);opacity:.6;animation:blob 18s ease-in-out infinite alternate}
.aurora i:nth-child(1){background:rgba(122,163,60,.34);top:-16vw;right:-10vw}
.aurora i:nth-child(2){background:rgba(217,154,43,.22);bottom:-20vw;left:-8vw;animation-delay:-6s}
.aurora i:nth-child(3){background:rgba(47,107,58,.16);top:32vh;left:32vw;animation-delay:-11s}
@keyframes blob{from{transform:translate3d(0,0,0) scale(1)}to{transform:translate3d(3vw,-2vh,0) scale(1.12)}}

.auth-hero{position:relative;z-index:1;max-width:520px}
.hero-badge{
  display:inline-flex;align-items:center;gap:7px;font-size:10px;font-weight:800;letter-spacing:.14em;
  color:#3f6b34;background:rgba(255,255,255,.62);border:1px solid #dfe7cf;padding:6px 11px;
  border-radius:999px;backdrop-filter:blur(8px);
}
.auth-hero h2{font-size:clamp(28px,3.4vw,42px);line-height:1.32;margin:16px 0 12px;letter-spacing:-.02em;color:#1e2a19}
.auth-hero p{font-size:13.5px;color:#5d6b50;line-height:1.95;max-width:430px}
.hero-list{list-style:none;margin:18px 0 0;display:flex;flex-direction:column;gap:9px;padding:0}
.hero-list li{display:flex;align-items:center;gap:9px;font-size:12.3px;color:#4d5a42;font-weight:600}
.hero-list .ico{width:15px;height:15px;color:#3f7d3a}
.hero-3d{position:relative;height:150px;margin-top:8px}
.hero-orb{
  position:absolute;inset-inline-start:10px;top:0;width:128px;height:128px;border-radius:50%;
  background:
    radial-gradient(circle at 32% 26%,rgba(255,255,255,.96),rgba(255,255,255,.2) 32%,transparent 44%),
    conic-gradient(from 200deg,#a3c965,#4f8a44,#d99a2b,#a3c965);
  box-shadow:0 40px 60px -30px rgba(60,110,50,.75),inset -10px -14px 30px rgba(30,50,20,.35);
  animation:float 7s ease-in-out infinite;
}
.hero-float{
  position:absolute;inset-inline-start:116px;top:32px;background:rgba(255,255,255,.8);
  border:1px solid #fff;backdrop-filter:blur(12px);border-radius:16px;padding:12px 14px;
  box-shadow:0 22px 44px -24px rgba(40,60,30,.5);transform:rotate(-3deg);
  animation:float 9s ease-in-out infinite;animation-delay:-2s;
}
.hero-float b{display:block;font-size:16px;color:#2f6b3a;font-variant-numeric:tabular-nums}
.hero-float small{font-size:9.5px;color:#6f7a63}
@keyframes float{0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-9px) rotate(-1deg)}}

.auth-card{
  position:relative;z-index:1;width:100%;max-width:440px;margin:0 auto;
  background:rgba(255,253,248,.76);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
  border:1px solid rgba(255,255,255,.78);border-radius:22px;padding:26px;
  box-shadow:0 30px 70px -34px rgba(35,55,25,.5),inset 0 1px 0 rgba(255,255,255,.7);
}
.auth-logo{
  width:58px;height:58px;border-radius:17px;margin:0 auto 10px;display:grid;place-items:center;font-size:0;
  background:linear-gradient(145deg,#4d9157,#2a5f34);
  box-shadow:0 14px 26px -14px rgba(47,107,58,.9),inset 0 1px 0 rgba(255,255,255,.4);
}
.auth-logo svg{width:27px;height:27px;color:#fff}
.auth-brand h1{font-size:17.5px;color:#1e2a19}
.auth-brand p{font-size:11.5px;color:var(--muted)}
.auth-tabs{background:#eef1e6;border-radius:12px;padding:4px;margin-bottom:16px}
.auth-tab{border-radius:9px;padding:9px;font-size:12.5px;color:var(--muted)}
.auth-tab.active{background:#fff;color:var(--primary);box-shadow:0 1px 5px rgba(30,40,20,.14)}
.auth-form input,.auth-form select{min-height:44px}
.auth-form .btn-block{min-height:44px}
.auth-form .btn-solid{box-shadow:0 12px 24px -16px rgba(47,107,58,.9)}
.auth-or{color:var(--muted)}
.auth-or::before,.auth-or::after{background:var(--line)}
.auth-link{color:var(--primary)}
.auth-note{background:#f7f8ef;border:1px dashed #dbe2cc;border-radius:10px;color:#5f6b52}
.auth-msg{border-radius:10px}
.auth-msg.error{background:#fbeae7;color:#a02a1e;border-color:#f0d2cc}
.auth-msg.ok{background:#edf4e4;color:#2f6b3a;border-color:#cfe0bd}
.auth-msg.info{background:#e9f2f5;color:#1a6076;border-color:#c7dde5}
.auth-foot{color:var(--muted);font-size:10.5px}
.status-ico{
  width:56px;height:56px;border-radius:17px;display:grid;place-items:center;margin:0 auto 12px;
  background:#f6f2e0;border:1px solid #ecdfb8;color:#9a6f12;
}
.status-ico .ico{width:26px;height:26px}
.status-ico.off{background:#fbeae7;border-color:#f0d2cc;color:#a02a1e}

/* ---------------- قائمة الجوال ---------------- */
.mobile-nav{display:none}
.mnav{
  position:relative;border:0;background:none;color:var(--muted);font-family:inherit;
  font-size:8.8px;font-weight:600;display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:5px 7px;border-radius:10px;cursor:pointer;min-width:54px;
}
.mnav .ico{width:19px;height:19px}
.mnav.active{color:var(--primary);background:#f2f6e9}
.mnav .dot{
  position:absolute;top:3px;inset-inline-end:11px;width:6px;height:6px;border-radius:50%;
  background:var(--accent);display:none;
}
.mnav.has-pending .dot{display:block}

/* ---------------- استجابة ---------------- */
@media(max-width:1100px){
  #appShell{grid-template-columns:224px minmax(0,1fr)}
  .container{padding:16px}
}
@media(max-width:960px){
  #appShell{grid-template-columns:1fr}
  .sidebar{display:none}
  .workspace{min-height:100vh}
  .mobile-brand{display:flex}
  header.topbar{flex-wrap:nowrap;padding:9px 12px;gap:6px}
  .branch-picker span{display:none}
  .branch-picker select{min-width:0;max-width:128px;padding:7px 20px 7px 8px;font-size:11px}
  .user-chip{padding:0;background:none;border:0}
  .user-chip .u-meta{display:none}
  .avatar{width:32px;height:32px}
  header.topbar .icon-btn{width:32px;height:32px}
  .container{padding:13px 12px 92px}
  .mobile-nav{
    display:flex;position:fixed;bottom:0;inset-inline:0;z-index:60;justify-content:space-around;
    background:rgba(255,253,248,.94);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
    border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .stat-grid{grid-template-columns:repeat(2,1fr);gap:8px}
  .stat-card .value{font-size:19px}
  .card{padding:13px}
  .modal{border-radius:16px;padding:18px}
  .auth-shell{grid-template-columns:1fr;padding:22px 16px}
  .auth-hero{display:none}
  .auth-card{padding:22px;border-radius:22px}
  .receipt-wrap{max-height:64vh}
}
@media(max-width:420px){
  .mobile-brand b{max-width:92px}
  .branch-picker select{max-width:106px}
  .stat-grid{grid-template-columns:1fr}
}

/* ---------------- الطباعة ---------------- */
@media print{
  .sidebar,header.topbar,.mobile-nav,.conn-bar,.toast,.toolbar,.no-print{display:none!important}
  #appShell{display:block!important}
  .workspace{min-height:0}
  .container{padding:0;max-width:100%}
  body{background:#fff}
  .card{box-shadow:none}
  .stat-card{box-shadow:none}
  .stat-card .label{padding-inline-end:0}
}
