/* =================================================================
   منصة النورس للموارد البشرية — نظام التصميم
   ألوان الهوية الرسمية من تطبيق أسماك النورس
   ================================================================= */
/* خط Almarai — نفس خط تطبيق أسماك النورس، مستضاف داخل المنصة (لا يُرسل أي طلب لخوادم خارجية) */
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(../fonts/almarai-arabic-400-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(../fonts/almarai-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(../fonts/almarai-arabic-700-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(../fonts/almarai-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url(../fonts/almarai-arabic-800-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url(../fonts/almarai-latin-800-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
:root {
  /* ألوان تطبيق أسماك النورس كما هي في ملفاته (index.css) */
  --teal: #24889B;
  --teal-d: #1b6b7a;
  --teal-dd: #14535e;
  --ink: #093037;
  --ink-2: #0f4c56;
  --orange: #F47B20;
  --orange-d: #d96a15;
  --orange-l: #fff3ea;
  --teal-l: #e7f4f6;
  --sand: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --ok: #16a34a;   --ok-l: #e8f7ee;
  --bad: #dc2626;  --bad-l: #fdecec;
  --warn: #b45309; --warn-l: #fff4e0;
  --info: #1d6fa5; --info-l: #e8f2fa;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px rgba(15,23,42,.07);
  --font: "Almarai", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* خلفية التطبيق: القشور تحت طبقة التيل الغامق */
  --app-shell: linear-gradient(165deg, rgba(26,112,126,.80) 0%, rgba(13,66,75,.86) 55%, rgba(8,40,46,.92) 100%), url(../brand/scale-texture-tile.jpg);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--sand); color: var(--text); font-size: 15px; line-height: 1.6; }
[hidden] { display: none !important; }
a { color: var(--teal-d); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

/* ---------- عناصر عامة ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 18px;
  background: var(--teal); color: #fff; font-weight: 800; cursor: pointer; text-decoration: none; transition: transform .08s, background .15s, opacity .15s; white-space: nowrap; }
.btn:hover { background: var(--teal-d); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.orange { background: var(--orange); } .btn.orange:hover { background: var(--orange-d); }
.btn.ghost { background: transparent; color: var(--teal-d); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--teal-l); }
.btn.danger { background: var(--bad); } .btn.danger:hover { background: #9b1c22; }
.btn.light { background: var(--teal-l); color: var(--teal-dd); } .btn.light:hover { background: #d3eaee; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.lg { padding: 16px 22px; font-size: 17px; border-radius: 14px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 14px; }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .g2, .g3 { grid-template-columns: 1fr; } }
.sp { flex: 1; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--teal-l); color: var(--teal-dd); white-space: nowrap; }
.chip.ok { background: var(--ok-l); color: var(--ok); }
.chip.bad { background: var(--bad-l); color: var(--bad); }
.chip.warn { background: var(--warn-l); color: var(--warn); }
.chip.info { background: var(--info-l); color: var(--info); }
.chip.orange { background: var(--orange-l); color: var(--orange-d); }
.chip.gray { background: #eef1f2; color: #55666c; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: currentColor; }

/* ---------- النماذج ---------- */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--teal-dd); margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(36,136,155,.12); }
textarea.input { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--teal); flex: none; margin-top: 2px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- الجداول ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 700; padding: 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; background: #fbfcfc; position: sticky; top: 0; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: #fafcfc; }
table.t tr.click { cursor: pointer; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ---------- نوافذ وتنبيهات ---------- */
.toast-box { position: fixed; inset-inline: 0; bottom: 18px; display: grid; justify-items: center; gap: 8px; z-index: 300; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 700; max-width: 520px; animation: tin .2s ease-out; pointer-events: auto; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(8,30,36,.55); z-index: 200; display: grid; place-items: center; padding: 16px; animation: fade .15s; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal.wide { max-width: 980px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-h h2 { margin: 0; font-size: 17px; flex: 1; }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-start; position: sticky; bottom: 0; background: #fff; }
.x { border: 0; background: var(--teal-l); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 18px; color: var(--teal-dd); }
.alert { padding: 12px 14px; border-radius: 12px; background: var(--info-l); color: var(--info); font-size: 14px; line-height: 1.7; }
.alert.warn { background: var(--warn-l); color: var(--warn); }
.alert.bad { background: var(--bad-l); color: var(--bad); }
.alert.ok { background: var(--ok-l); color: var(--ok); }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(36,136,155,.2); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 48px; }

/* ---------- محتوى السياسات (Markdown) ---------- */
.md { line-height: 1.95; font-size: 15px; }
.md h2 { font-size: 17px; color: var(--teal-dd); margin: 20px 0 8px; padding-top: 6px; }
.md h3 { font-size: 15px; margin: 14px 0 6px; }
.md ul, .md ol { padding-inline-start: 22px; margin: 6px 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 10px 0; display: block; overflow-x: auto; }
.md td, .md th { border: 1px solid var(--line); padding: 7px 9px; text-align: right; vertical-align: top; }
.md th { background: var(--teal-l); }
.md p { margin: 8px 0; }

/* ---------- شاشة الدخول ---------- */
.auth-bg { min-height: 100vh; min-height: 100dvh; background-color: #0f4c56; background-image: var(--app-shell); background-repeat: no-repeat, repeat; background-size: auto, 320px; background-attachment: fixed, fixed; display: grid; place-items: center; padding: 20px 16px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 24px; padding: 28px 24px; box-shadow: 0 40px 90px rgba(0,0,0,.4); }
.auth-card .logo { display: block; height: 104px; margin: -6px auto 6px; }
.auth-card h1 { font-size: 20px; text-align: center; margin: 0 0 4px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.pin-input { letter-spacing: 10px; text-align: center; font-size: 22px; font-weight: 800; }
.auth-foot { text-align: center; margin-top: 14px; font-size: 12px; color: var(--muted); }
.auth-foot a { color: var(--teal-d); }

/* =================================================================
   بوابة الموظف (جوال أولاً)
   ================================================================= */
.p-app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: 92px; }
.p-head { background-color: #24889b; isolation: isolate; color: #fff;
  padding: calc(16px + env(safe-area-inset-top)) 18px 66px; border-radius: 0 0 28px 28px; position: relative; }
.p-head .top { display: flex; align-items: center; gap: 10px; }
.p-head .top img { height: 42px; }
.p-head::before, .scale-header::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .3; mix-blend-mode: overlay; pointer-events: none; background: url(../brand/scale-texture-dark-tile.jpg) repeat; background-size: 220px; border-radius: inherit; }
.scale-header { background-color: #24889b; position: relative; isolation: isolate; color: #fff; }
.p-head .hello { margin-top: 18px; font-size: 21px; font-weight: 800; }
.p-head .meta { font-size: 13px; font-weight: 700; }
.p-head .lang { margin-inline-start: auto; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 10px; padding: 6px 10px; font-weight: 700; cursor: pointer; }
.p-body { padding: 0 14px; margin-top: -48px; position: relative; }
.p-section-title { font-size: 14px; font-weight: 800; color: var(--teal-dd); margin: 20px 4px 8px; }

.punch-card { text-align: center; padding: 22px 18px; }
.punch-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; padding: 6px 14px; border-radius: 999px; background: var(--teal-l); color: var(--teal-dd); font-size: 14px; }
.punch-state.on { background: var(--ok-l); color: var(--ok); }
.punch-state.brk { background: var(--orange-l); color: var(--orange-d); }
.punch-state.out { background: var(--bad-l); color: var(--bad); }
.clock { font-size: 44px; font-weight: 800; letter-spacing: 1px; margin: 10px 0 2px; direction: ltr; }
.punch-btn { width: 168px; height: 168px; border-radius: 50%; border: 0; margin: 14px auto 6px; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 30% 25%, #ffa45c, var(--orange) 55%, var(--orange-d)); color: #fff; font-weight: 800; font-size: 19px;
  box-shadow: 0 16px 34px rgba(244,123,32,.38), inset 0 -6px 0 rgba(0,0,0,.08); transition: transform .1s; position: relative; }
.punch-btn::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(244,123,32,.25); animation: pulse 2.2s ease-out infinite; }
@keyframes pulse { from { transform: scale(.92); opacity: 1; } to { transform: scale(1.12); opacity: 0; } }
.punch-btn.teal { background: radial-gradient(circle at 30% 25%, #3fa6b9, var(--teal) 55%, var(--teal-d)); box-shadow: 0 16px 34px rgba(36,136,155,.35); }
.punch-btn.teal::after { border-color: rgba(36,136,155,.25); }
.punch-btn:active { transform: scale(.97); }
.punch-btn svg { width: 44px; height: 44px; display: block; margin: 0 auto 4px; }
.locks { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.locks span { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #f1f5f6; color: #4a5d63; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.tile { background: #fff; border-radius: 14px; padding: 12px; text-align: center; box-shadow: var(--shadow); }
.tile b { display: block; font-size: 20px; direction: ltr; }
.tile span { font-size: 12px; color: var(--muted); }

.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-l); color: var(--teal-d); flex: none; font-size: 18px; }
.list-item .tx { flex: 1; min-width: 0; }
.list-item .tx b { display: block; font-size: 14px; }
.list-item .tx small { color: var(--muted); font-size: 12px; }
button.list-item { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: inherit; cursor: pointer; }

.p-nav { position: fixed; bottom: 0; inset-inline: 0; background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  display: flex; justify-content: center; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 50; }
.p-nav .in { display: flex; max-width: 560px; width: 100%; }
.p-nav button { flex: 1; border: 0; background: none; padding: 6px 2px; display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: #7b8c92; cursor: pointer; border-radius: 12px; }
.p-nav button svg { width: 23px; height: 23px; }
.p-nav button.on { color: var(--teal-d); background: var(--teal-l); }
.badge { background: var(--orange); color: #fff; border-radius: 999px; font-size: 10px; padding: 0 6px; min-width: 18px; display: inline-block; text-align: center; }

.banner { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--orange-l); color: #8a3b00; font-weight: 700; margin-bottom: 12px; }
.banner.teal { background: var(--teal-l); color: var(--teal-dd); }
.banner.bad { background: var(--bad-l); color: var(--bad); }
.sheet-steps { display: grid; gap: 10px; margin: 6px 0 12px; }
.step { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: #f6f9fa; }
.step .st { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #dfe8ea; color: #50636a; font-weight: 800; flex: none; }
.step.ok .st { background: var(--ok); color: #fff; } .step.bad .st { background: var(--bad); color: #fff; } .step.run .st { background: var(--teal); color: #fff; }
.step .tx { flex: 1; } .step .tx small { display: block; color: var(--muted); font-size: 12px; }
.scan-box { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 1; max-width: 320px; margin: 0 auto; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-box .frame { position: absolute; inset: 18%; border: 3px solid var(--orange); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.code-input { font-size: 30px; letter-spacing: 12px; text-align: center; font-weight: 800; direction: ltr; }
.success-anim { width: 92px; height: 92px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; margin: 10px auto; animation: pop .35s ease-out; }
.success-anim svg { width: 50px; height: 50px; color: #fff; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } }
.cal { display: grid; gap: 8px; }
.cal .d { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.cal .d .dd { width: 48px; text-align: center; flex: none; }
.cal .d .dd b { display: block; font-size: 20px; line-height: 1.1; }
.cal .d .dd small { font-size: 11px; color: var(--muted); }
.cal .d.today { outline: 2px solid var(--orange); }
.bar { width: 5px; align-self: stretch; border-radius: 4px; background: var(--teal); flex: none; }

/* =================================================================
   لوحة الإدارة
   ================================================================= */
.a-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.a-side { background-color: #0f4c56; background-image: var(--app-shell); background-repeat: no-repeat, repeat; background-size: auto, 320px; color: #fff; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.a-side::before { content: none; }
.a-side > * { position: relative; z-index: 1; }
.a-brand { margin: 0 0 6px; padding: 18px 12px 14px; text-align: center; background-color: #24889b; position: relative; isolation: isolate; }
.a-brand::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .3; mix-blend-mode: overlay; background: url(../brand/scale-texture-dark-tile.jpg) repeat; background-size: 220px; }
.a-brand img { height: 74px; }
.a-brand div { font-size: 12px; color: #e6f4f7; font-weight: 800; margin-top: 6px; }
.a-nav { padding: 8px 12px; display: grid; gap: 2px; }
.a-nav .grp { font-size: 11px; color: #8fc3cc; padding: 12px 10px 4px; font-weight: 800; }
.a-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: #e6f4f7; text-decoration: none; font-weight: 700; font-size: 14px; }
.a-nav a:hover { background: rgba(255,255,255,.09); }
.a-nav a.on { background: #24889b; color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.12); }
.a-nav a .badge { margin-inline-start: auto; }
.a-nav svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.a-user { margin: auto 12px 14px; padding: 12px 14px; font-size: 13px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; color: #cfe4e8; }
.a-user b { color: #fff; display: block; }
.a-main { min-width: 0; }
.a-top { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: rgba(248,250,252,.92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.a-top h1 { margin: 0; font-size: 19px; flex: 1; }
.a-content { padding: 22px 24px 60px; max-width: 1400px; }
.menu-btn { display: none; border: 0; background: var(--teal-l); color: var(--teal-dd); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; }
@media (max-width: 980px) {
  .a-shell { grid-template-columns: 1fr; }
  .a-side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; z-index: 100; transform: translateX(100%); transition: transform .2s; }
  .a-side.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .menu-btn { display: grid; place-items: center; }
  .a-top { padding: 12px 16px; }
  .a-content { padding: 16px; }
}
.kpi { background: #fff; border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.kpi .v { font-size: 30px; font-weight: 800; direction: ltr; text-align: right; line-height: 1.2; }
.kpi .l { font-size: 13px; color: var(--muted); }
.kpi.orange .v { color: var(--orange-d); } .kpi.bad .v { color: var(--bad); } .kpi.ok .v { color: var(--ok); }
.branch-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.branch-card .bh { padding: 14px 16px; background: linear-gradient(135deg, #24889b, #1b6b7a); position: relative; isolation: isolate; color: #fff; display: flex; align-items: center; gap: 10px; }
.branch-card .bh::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .3; mix-blend-mode: overlay; background: url(../brand/scale-texture-dark-tile.jpg) repeat; background-size: 220px; }
.branch-card .bh b { font-size: 17px; flex: 1; }
.branch-card .bb { padding: 14px 16px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stat-row div b { display: block; font-size: 22px; direction: ltr; }
.stat-row div span { font-size: 11px; color: var(--muted); }
.stat-row .ok b { color: var(--ok); } .stat-row .bad b { color: var(--bad); } .stat-row .warn b { color: var(--warn); } .stat-row .or b { color: var(--orange-d); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 150px; padding: 9px 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 0; background: #fff; padding: 8px 14px; border-radius: 10px; font-weight: 700; cursor: pointer; color: var(--muted); box-shadow: var(--shadow); }
.tabs button.on { background: var(--teal); color: #fff; }
.state-inside { color: var(--ok); } .state-break { color: var(--orange-d); } .state-outside { color: var(--bad); } .state-nosignal { color: #8a6d00; }
.state-late { color: var(--warn); } .state-absent { color: var(--bad); } .state-done, .state-off, .state-upcoming { color: #6b7d83; }
.roster { border-collapse: separate; border-spacing: 4px; min-width: 860px; width: 100%; }
.roster th { font-size: 12px; color: var(--muted); padding: 6px; text-align: center; }
.roster th.emp, .roster td.emp { text-align: right; min-width: 170px; }
.roster td.cell { height: 52px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; text-align: center; font-size: 12px; font-weight: 700; padding: 4px; }
.roster td.cell:hover { box-shadow: inset 0 0 0 2px var(--teal); }
.roster td.cell.off { background: #f1f3f4; color: #8a979b; }
.roster td.cell.leave { background: var(--orange-l); color: var(--orange-d); cursor: default; }
.roster td.cell.ext { background: #f6f6f6; color: #999; cursor: not-allowed; }
.roster td.cell.dirty { outline: 2px dashed var(--orange); }
.radar { width: 100%; max-width: 360px; display: block; margin: 0 auto; }
.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl { position: relative; padding: 6px 0 10px; }
.tl::before { content: ""; position: absolute; inset-inline-start: -19px; top: 11px; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px #fff; }
.tl.bad::before { background: var(--bad); } .tl.warn::before { background: var(--orange); } .tl.ok::before { background: var(--ok); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 700; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 26px; font-weight: 800; letter-spacing: 3px; text-align: center; background: var(--orange-l); color: var(--orange-d); padding: 14px; border-radius: 14px; direction: ltr; user-select: all; }
.progress { height: 8px; border-radius: 99px; background: #e7eef0; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }

/* ---------- الطباعة (قسائم الرواتب والخطابات) ---------- */
.print-doc { background: #fff; max-width: 800px; margin: 0 auto; padding: 32px; }
.print-doc .ph { display: flex; align-items: center; justify-content: space-between; border-bottom: 3px solid var(--orange); padding-bottom: 12px; margin-bottom: 18px; }
.print-doc .ph img { height: 80px; }
@media print {
  body { background: #fff; }
  .no-print, .a-side, .a-top, .p-nav, .modal-h, .modal-f, .toast-box { display: none !important; }
  .modal-bg { position: static; background: none; padding: 0; display: block; }
  .modal { box-shadow: none; max-height: none; max-width: none; }
  .a-shell { display: block; }
}

/* ---------- شاشة الفرع (الكشك) ---------- */
.k-wrap { min-height: 100vh; min-height: 100dvh; background-color: #0f4c56; background-image: var(--app-shell); background-repeat: no-repeat, repeat; background-size: auto, 320px; color: #fff; display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; padding: 28px; align-items: center; }
@media (max-width: 860px) { .k-wrap { grid-template-columns: 1fr; padding: 16px; } }
.k-panel { background: rgba(18,63,73,.86); border-radius: 26px; padding: 28px; backdrop-filter: blur(6px); }
.k-qr { background: #fff; border-radius: 22px; padding: 18px; width: min(380px, 80vw); aspect-ratio: 1; margin: 0 auto; display: grid; place-items: center; }
.k-qr canvas, .k-qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.k-code { font-size: 54px; font-weight: 800; letter-spacing: 12px; text-align: center; direction: ltr; margin-top: 14px; color: #ffd2ad; }
.k-timer { height: 6px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; margin: 10px auto 0; max-width: 380px; }
.k-timer i { display: block; height: 100%; background: var(--orange); transition: width 1s linear; }
.k-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 360px; margin: 14px auto 0; }
.k-pad button { height: 64px; border-radius: 16px; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 26px; font-weight: 800; cursor: pointer; }
.k-pad button:active { background: rgba(255,255,255,.25); }
.k-display { background: rgba(255,255,255,.08); border-radius: 14px; padding: 14px; text-align: center; font-size: 26px; letter-spacing: 8px; font-weight: 800; min-height: 64px; direction: ltr; }
.k-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.k-actions .btn { padding: 18px; font-size: 18px; }

/* ---------- نبض النورس ---------- */
.pulse { background: var(--app-shell); background-size: auto, 260px; color: #e6f1f3; border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }
.pulse .ph { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pulse .ph img { height: 54px; }
.pulse .ph h2 { margin: 0; font-size: 26px; color: #fff; }
.pulse .ph h2 span { color: var(--orange); }
.pulse .ph p { margin: 2px 0 0; font-size: 13px; color: #9fc3ca; }
.pulse .pclock { margin-inline-start: auto; font-size: 46px; font-weight: 800; direction: ltr; color: #fff; line-height: 1; }
.pulse .pclock small { display: block; font-size: 12px; color: #9fc3ca; font-weight: 700; text-align: left; }
.pulse .pctl { display: flex; gap: 10px; align-items: center; margin: 18px 0 8px; flex-wrap: wrap; }
.pulse .pctl input[type=range] { flex: 1; min-width: 200px; accent-color: var(--orange); direction: ltr; transform: scaleX(-1); }
.pulse .pctl .input { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.15); width: auto; }
.pulse .pctl .input option { color: #000; }
.pulse .btn.ghost { color: #e6f1f3; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.2); }
.pulse .btn.ghost:hover { background: rgba(255,255,255,.08); }
.plane { display: grid; grid-template-columns: 210px 1fr; gap: 14px; align-items: stretch; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.08); cursor: pointer; }
.plane.off { opacity: .55; cursor: default; }
.plane .nm b { font-size: 18px; color: #fff; display: block; }
.plane .nm .en { font-size: 11px; color: #7fa7af; letter-spacing: .5px; }
.plane .pst { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.plane .pst div { background: rgba(255,255,255,.06); border-radius: 8px; padding: 4px 6px; text-align: center; font-size: 10px; color: #9fc3ca; }
.plane .pst b { display: block; font-size: 16px; color: #fff; direction: ltr; }
.plane .cv { position: relative; min-height: 96px; background: rgba(255,255,255,.03); border-radius: 12px; overflow: hidden; }
.plane .cv svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.plane .head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--orange); box-shadow: 0 0 12px rgba(244,123,32,.8); pointer-events: none; }
.paxis { display: grid; grid-template-columns: 210px 1fr; gap: 14px; font-size: 11px; color: #7fa7af; }
.paxis .ticks { position: relative; height: 18px; direction: ltr; }
.paxis .ticks span { position: absolute; transform: translateX(-50%); }
.pfeed { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-top: 16px; }
@media (max-width: 900px) { .plane, .paxis { grid-template-columns: 1fr; } .paxis > span { display: none; } .pfeed { grid-template-columns: 1fr; } }
.pbox { background: rgba(255,255,255,.05); border-radius: 14px; padding: 14px; }
.pbox h4 { margin: 0 0 8px; color: #fff; font-size: 14px; }
.pev { display: flex; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.06); animation: tin .25s ease-out; }
.pev i { font-style: normal; direction: ltr; color: #9fc3ca; min-width: 42px; }
.pev.bad b { color: #ff9a9a; } .pev.warn b { color: #ffc28a; } .pev.ok b { color: #8fe0c6; }
.plegend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #9fc3ca; margin-top: 10px; }
.plegend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; margin-inline-end: 5px; }

/* ---------- عقد العمل (نمط العقد الموحد ثنائي اللغة) ---------- */
.ct { background: #fff; color: #1f2d33; max-width: 860px; margin: 0 auto; font-size: 13px; line-height: 1.75; }
.ct-head { background: linear-gradient(180deg, #eef6f7, #fff); border-radius: 14px; padding: 18px 20px 10px; display: flex; align-items: center; gap: 16px; }
.ct-head img { height: 86px; }
.ct-head .tt { margin-inline-start: auto; text-align: left; }
.ct-head h1 { margin: 0; font-size: 26px; color: #0d2f38; text-align: right; }
.ct-head h2 { margin: 0; font-size: 18px; color: #24889B; direction: ltr; font-weight: 800; }
.ct-note { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 10px 6px; font-size: 12px; color: #4b5d63; }
.ct-note .en { direction: ltr; text-align: left; }
.ct-sec { border: 1px solid #dfe7e9; border-radius: 12px; margin: 12px 0; overflow: hidden; break-inside: avoid; }
.ct-sec > .ct-bar { display: flex; justify-content: space-between; background: #eef3f4; padding: 8px 14px; font-weight: 800; color: #0d2f38; }
.ct-sec > .ct-bar .en { direction: ltr; }
.ct-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1.1fr; gap: 8px; padding: 7px 14px; border-top: 1px dashed #e3eaec; align-items: start; }
.ct-row .le { direction: ltr; text-align: left; color: #5b6f76; }
.ct-row .ve { direction: ltr; text-align: left; font-weight: 700; }
.ct-row .va { font-weight: 700; }
.ct-row .la { color: #5b6f76; }
.ct-cl { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 8px 14px; border-top: 1px dashed #e3eaec; }
.ct-cl .en { direction: ltr; text-align: left; color: #34474d; }
.ct-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 18px; }
.ct-sign div { border: 1.5px dashed #cfdcdf; border-radius: 12px; padding: 14px; min-height: 110px; }
.ct-foot { display: flex; justify-content: space-between; font-size: 11px; color: #7a8b90; margin-top: 12px; border-top: 2px solid #F47B20; padding-top: 6px; }
.ct-draft { background: #fff4e0; color: #8a4b00; border-radius: 10px; padding: 8px 12px; font-size: 12px; margin-top: 10px; text-align: center; }
.ct-verify { display: flex; gap: 14px; align-items: center; border: 1.5px solid #dfe7e9; border-radius: 12px; padding: 10px 14px; margin-top: 12px; font-size: 12px; break-inside: avoid; }
.ct-verify img { width: 92px; height: 92px; }
.sig-pad { width: 100%; height: 170px; border: 2px dashed var(--teal); border-radius: 14px; background: #fbfdfd; display: block; cursor: crosshair; }

/* الطباعة وحفظ PDF بمقاس A4 */
@page { size: A4; margin: 12mm; }
@media print {
  body:has(.modal-bg) #app { display: none !important; }
  .modal-bg { overflow: visible !important; }
  .modal { max-height: none !important; overflow: visible !important; border-radius: 0; }
  .modal-b { padding: 0 !important; }
  .ct-sec, .ct-sign, .ct-verify, .card, tr { break-inside: avoid; }
  .card { box-shadow: none !important; border: 1px solid #e2eaec; }
  .a-content { padding: 0 !important; max-width: none; }
  .toolbar, .tabs button:not(.on), .btn { display: none !important; }
  a[href]::after { content: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.print-head { display: none; }
@media print {
  .print-head { display: flex !important; align-items: center; gap: 14px; border-bottom: 3px solid var(--orange); padding-bottom: 8px; margin-bottom: 12px; }
  .print-head img { height: 60px; }
  .print-head > .num { margin-inline-start: auto; font-size: 12px; color: #555; }
  body:has(.modal-bg) .print-head { display: none !important; }
  .a-main { display: block; }
  .pulse { background: #123f49 !important; }
}
@media screen and (max-width: 640px) {
  .ct-row { grid-template-columns: 1fr 1fr; }
  .ct-cl, .ct-note, .ct-sign { grid-template-columns: 1fr; }
  .ct-head h1 { font-size: 20px; } .ct-head img { height: 60px; }
}

/* ---------- صفحات الدخول الرسمية ---------- */
.lg-card { width: 100%; max-width: 440px; background: #fff; border-radius: 28px; overflow: hidden; box-shadow: 0 40px 90px rgba(0,0,0,.45); animation: lgIn .35s ease-out; }
@keyframes lgIn { from { transform: translateY(14px); opacity: 0; } }
.lg-top { padding: 30px 24px 24px; text-align: center; position: relative; }
.lg-badge { width: 92px; height: 92px; border-radius: 50%; background: #fff; display: grid; place-items: center; margin: 0 auto 12px; box-shadow: 0 10px 26px rgba(0,0,0,.25), 0 0 0 6px rgba(255,255,255,.18); }
.lg-badge img { width: 80px; height: 80px; object-fit: contain; }
.lg-top .wm { height: 40px; display: block; margin: 0 auto 10px; }
.lg-top h1 { color: #fff; font-size: 21px; margin: 4px 0 2px; }
.lg-top p { color: #d7eef2; font-size: 12px; margin: 0; letter-spacing: .3px; }
.lg-lang { position: absolute; top: 14px; inset-inline-start: 14px; background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 12px; cursor: pointer; }
.lg-body { padding: 22px 24px 10px; }
.lg-body .field > span { color: #334155; }
.lg-step { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 12px; color: #64748b; margin-bottom: 14px; }
.lg-step i { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; display: inline-block; }
.lg-step i.on { background: var(--teal); width: 22px; border-radius: 99px; }
.lg-who { display: flex; align-items: center; gap: 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; }
.lg-who b { flex: 1; direction: ltr; text-align: right; }
.lg-trust { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 14px 0 6px; }
.lg-trust span { font-size: 11px; background: #f1f5f9; color: #475569; border-radius: 999px; padding: 4px 10px; }
.lg-or { display: flex; align-items: center; gap: 10px; color: #94a3b8; font-size: 12px; margin: 14px 0; }
.lg-or::before, .lg-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lg-foot { background: #f8fafc; border-top: 1px solid var(--line); padding: 12px 18px; text-align: center; font-size: 11px; color: #64748b; line-height: 1.9; }
.lg-foot a { color: var(--teal-d); font-weight: 700; }
.btn.face { background: #0f172a; color: #fff; } .btn.face:hover { background: #1e293b; }
.otp { display: flex; gap: 8px; justify-content: center; direction: ltr; margin: 4px 0 6px; }
.otp input { width: 46px; height: 56px; min-width: 0; flex: 0 1 46px; text-align: center; font-size: 24px; font-weight: 800; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--text); -webkit-text-security: disc; }
.otp.plain input { -webkit-text-security: none; }
.otp input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(36,136,155,.14); outline: none; }
.otp input.filled { border-color: #9cc9d2; background: #f5fbfc; }
.otp.err input { border-color: var(--bad); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (max-width: 360px) { .otp { gap: 5px; } .otp input { height: 50px; font-size: 20px; border-radius: 11px; } .lg-body { padding: 18px 16px 8px; } }
.mfa-qr { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px; width: 200px; margin: 6px auto; }
.mfa-qr img { width: 100%; display: block; image-rendering: pixelated; }

/* ---------- الدخول الرسمي والأمان (إضافات) ---------- */
.toast.warn { background: var(--warn); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-left: 44px; }
.pw-eye { position: absolute; top: 50%; transform: translateY(-50%); left: 6px; width: 34px; height: 34px; border: 0; background: transparent; color: #64748b; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { background: #f1f5f9; } .pw-eye svg { width: 19px; height: 19px; }
.mfa-steps { margin: 0 0 8px; padding-inline-start: 20px; font-size: 13.5px; color: #334155; line-height: 1.9; }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.card.flat { box-shadow: none; border: 1.5px solid var(--line); margin: 0; }
.a-brand .bd { height: 58px; width: 58px; border-radius: 50%; background: #fff; padding: 4px; display: block; margin: 0 auto 8px; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.a-brand .wm { height: 30px; display: block; margin: 0 auto; }
.lg-face { display: grid; gap: 10px; }
.lg-face .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.lg-face .btn svg { width: 22px; height: 22px; }
.lg-who .ch { border: 0; background: none; color: var(--teal-d); font-weight: 700; cursor: pointer; font-size: 12px; }
.lg-hint { text-align: center; font-size: 12px; color: #64748b; margin: 10px 0 0; line-height: 1.8; }
.brand-lock { display: inline-flex; align-items: center; gap: 10px; }
.brand-lock .bd { width: 44px; height: 44px; border-radius: 50%; background: #fff; padding: 3px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.brand-lock .wm { height: 30px; width: auto; }
.p-head .top .brand-lock img.bd { height: 44px; } .p-head .top .brand-lock img.wm { height: 30px; }

/* =================================================================
   القشرة الرسمية — طابع أسماك النورس في كل الواجهات
   ================================================================= */
:root { --scale: url(../brand/scale-texture-tile.jpg); --scale-d: url(../brand/scale-texture-dark-tile.jpg); --brand-line: linear-gradient(90deg, #24889B, #1b6b7a 60%, #F47B20); }
/* الخلفيات الداكنة: القشور ظاهرة بوضوح تحت التيل */
.auth-bg, .a-side, .k-wrap { background-size: auto, 260px !important; }
/* الرؤوس التيل: قشور أوضح */
.p-head::before, .scale-header::before, .a-brand::before, .branch-card .bh::before { opacity: .26 !important; background-size: 220px !important; }
/* خلفية المحتوى الفاتحة: قشور خفيفة كالعلامة المائية */
body { background-color: #f3f7f8; background-image: linear-gradient(rgba(244,248,249,.965), rgba(244,248,249,.975)), var(--scale); background-size: auto, 240px; background-attachment: fixed, fixed; }
/* حافة القشور أسفل رأس صفحة الدخول */
.lg-top { overflow: visible; }
.lg-top::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 12px; background: radial-gradient(circle at 11px 0, transparent 11px, #fff 11.6px) 0 0/22px 12px repeat-x; }
.lg-card { border: 1px solid rgba(255,255,255,.35); box-shadow: 0 40px 90px rgba(0,0,0,.45), 0 0 0 8px rgba(255,255,255,.06); }
.lg-badge { box-shadow: 0 10px 26px rgba(0,0,0,.28), 0 0 0 5px rgba(255,255,255,.22), 0 0 0 11px rgba(255,255,255,.08); }
/* الشريط العلوي للوحة: خط الهوية */
.a-top { border-bottom: 0; box-shadow: 0 1px 0 var(--line); }
.a-top::after { content: ""; position: absolute; inset-inline: 0; bottom: -3px; height: 3px; background: var(--brand-line); opacity: .9; }
/* رؤوس النوافذ بقشرة الهوية */
.modal-h { background-color: #24889b; color: #fff; border-bottom: 0; isolation: isolate; overflow: hidden; }
.modal-h::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .24; mix-blend-mode: overlay; background: var(--scale-d) 0 0/200px repeat; }
.modal-h h2 { color: #fff; }
.modal-h .x { color: #fff !important; background: rgba(255,255,255,.16) !important; }
/* بطاقات المؤشرات: لمسة قشور في الزاوية */
.kpi { position: relative; overflow: hidden; isolation: isolate; }
.kpi::after { content: ""; position: absolute; z-index: -1; inset-inline-end: -34px; top: -34px; width: 120px; height: 120px; border-radius: 50%; background: var(--scale) 0 0/150px; opacity: .07; }
.kpi::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; background: var(--brand-line); }
/* عناوين البطاقات: قشرة صغيرة قبل العنوان */
.card > h3:first-child { display: flex; align-items: center; gap: 8px; }
.card > h3:first-child::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: linear-gradient(160deg, #2fa3b8, #1b6b7a); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
/* شريط التنقل السفلي في البوابة */
.p-nav { box-shadow: 0 -8px 24px rgba(15,23,42,.06); }
.p-nav::before { content: ""; position: absolute; inset-inline: 0; top: -1px; height: 2px; background: var(--brand-line); opacity: .8; }
/* شاشات الطباعة بلا خلفيات */
@media print { body { background: #fff !important; } .kpi::after, .kpi::before, .card > h3:first-child::before { display: none; } .modal-h { background: #fff; color: #000; } }

/* ---------- مركز القيادة ---------- */
.cc-hero { position: relative; overflow: hidden; isolation: isolate; border-radius: 24px; padding: 26px 28px; color: #fff; display: flex; align-items: center; gap: 24px;
  background-color: #0f4c56; background-image: var(--app-shell); background-size: auto, 240px; box-shadow: 0 18px 40px rgba(9,48,55,.25); }
.cc-hero::after { content: ""; position: absolute; z-index: -1; width: 420px; height: 420px; border-radius: 50%; inset-inline-start: -140px; top: -220px; background: radial-gradient(circle, rgba(244,123,32,.22), transparent 65%); }
.cc-hi { flex: 1; min-width: 0; }
.cc-greet { font-size: 26px; font-weight: 800; letter-spacing: -.2px; }
.cc-date { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #cfe7ec; font-size: 13px; font-weight: 700; margin-top: 4px; }
.cc-date .dot { width: 4px; height: 4px; border-radius: 50%; background: #F47B20; }
.cc-clock { font-size: 42px; font-weight: 800; letter-spacing: 2px; margin: 8px 0 12px; direction: ltr; text-align: right; line-height: 1; color: #fff; text-shadow: 0 4px 18px rgba(0,0,0,.25); }
.cc-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-pills span { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; backdrop-filter: blur(4px); }
.cc-pills span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9fc9d1; }
.cc-pills .ok::before { background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.2); } .cc-pills .or::before { background: #F47B20; } .cc-pills .bad::before { background: #f87171; } .cc-pills .warn::before { background: #fbbf24; }
.cc-ring { position: relative; flex: none; display: grid; place-items: center; }
.cc-ring .ring circle:last-child { transition: stroke-dashoffset 1s ease-out; filter: drop-shadow(0 0 6px rgba(244,123,32,.5)); }
.cc-ring .in { position: absolute; text-align: center; display: grid; line-height: 1.25; }
.cc-ring .in b { font-size: 30px; } .cc-ring .in span { font-size: 12px; color: #cfe7ec; font-weight: 700; } .cc-ring .in small { font-size: 11px; color: #9fc9d1; }
.cc-quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.cc-quick a { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); color: var(--text); text-decoration: none; font-weight: 700; font-size: 12.5px; text-align: center; transition: transform .15s, box-shadow .15s; border: 1px solid transparent; }
.cc-quick a svg { width: 24px; height: 24px; color: var(--teal); padding: 8px; box-sizing: content-box; background: var(--teal-l); border-radius: 12px; }
.cc-quick a:hover { transform: translateY(-2px); border-color: #cfe3e7; box-shadow: 0 12px 28px rgba(15,76,86,.12); }
.cc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cc-kpi { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.cc-kpi::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--brand-line); opacity: .7; }
.cc-kpi .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.cc-kpi .ic svg { width: 23px; height: 23px; }
.cc-kpi .ic.ok { background: var(--ok-l); color: var(--ok); } .cc-kpi .ic.orange { background: #fff1e6; color: #d4600b; } .cc-kpi .ic.teal { background: var(--teal-l); color: var(--teal-d); } .cc-kpi .ic.info { background: var(--info-l); color: var(--info); }
.cc-kpi b { display: block; font-size: 26px; line-height: 1.1; } .cc-kpi span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.cc-attn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding: 12px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); border-inline-start: 4px solid #F47B20; }
.cc-attn-h { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; color: #b45309; margin-inline-end: 6px; } .cc-attn-h svg { width: 18px; height: 18px; }
.cc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 12px; text-decoration: none; font-size: 12.5px; font-weight: 700; background: #f1f5f9; color: var(--text); }
.cc-chip svg { width: 16px; height: 16px; } .cc-chip b { font-size: 14px; }
.cc-chip.teal { background: var(--teal-l); color: var(--teal-dd); } .cc-chip.orange { background: #fff1e6; color: #b4500a; } .cc-chip.warn { background: var(--warn-l); color: var(--warn); } .cc-chip.info { background: var(--info-l); color: var(--info); } .cc-chip.bad { background: var(--bad-l); color: var(--bad); }
.cc-sec-h { display: flex; align-items: baseline; gap: 10px; margin: 22px 2px 10px; } .cc-sec-h h2 { margin: 0; font-size: 17px; }
.cc-branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.cc-branch { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.cc-branch:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(15,76,86,.13); }
.cc-branch header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; }
.cc-branch header b { display: block; font-size: 16px; } .cc-branch header small { color: #d7eef2; font-size: 12px; }
.mini-ring { position: relative; display: grid; place-items: center; } .mini-ring b { position: absolute; font-size: 12px; }
.cc-b-body { padding: 14px 16px 16px; }
.cc-b-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.cc-b-foot .btn { margin-inline-start: auto; }
.cc-trend { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 170px; padding-top: 6px; }
.cc-trend .tb { display: grid; justify-items: center; gap: 4px; height: 100%; grid-template-rows: 1fr auto auto; }
.cc-trend .tb-col { position: relative; width: 100%; max-width: 34px; height: 100%; }
.cc-trend .tb-col i { position: absolute; bottom: 0; inset-inline: 0; border-radius: 8px 8px 4px 4px; min-height: 3px; }
.cc-trend .tb-col i.s { background: #e3eef0; } .cc-trend .tb-col i.p { inset-inline: 6px; background: linear-gradient(#2fa3b8, #1b6b7a); }
.cc-trend .tb b { font-size: 11.5px; } .cc-trend .tb span { font-size: 11px; color: var(--muted); font-weight: 700; }
.cc-legend { display: flex; gap: 14px; justify-content: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; } .cc-legend i.s { background: #e3eef0; } .cc-legend i.p { background: #24889B; }
@media (max-width: 1100px) { .cc-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .cc-hero { flex-direction: column-reverse; align-items: stretch; padding: 20px 18px; gap: 14px; }
  .cc-ring { align-self: center; } .cc-greet { font-size: 21px; } .cc-clock { font-size: 34px; text-align: center; } .cc-date, .cc-pills { justify-content: center; } .cc-greet { text-align: center; }
  .cc-quick { gap: 8px; } .cc-quick a { padding: 12px 4px; font-size: 11.5px; }
  .cc-kpi { padding: 12px; gap: 10px; } .cc-kpi .ic { width: 40px; height: 40px; } .cc-kpi b { font-size: 22px; }
  .cc-branches { grid-template-columns: 1fr; }
}
@media print { .cc-quick { display: none; } .cc-hero { background: #0f4c56 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* الشريط العلوي على الجوال: العنوان ثم الأدوات في سطر كامل */
@media (max-width: 700px) {
  .a-top { flex-wrap: wrap; row-gap: 8px; }
  .a-top h1 { font-size: 17px; min-width: 0; }
  .a-top #tb { order: 5; flex: 1 1 100%; flex-wrap: wrap; min-width: 0; }
  .a-top #tb:empty { display: none; }
  .a-top #tb select { flex: 1 1 160px; min-width: 0 !important; width: auto !important; }
  .a-top #prt { font-size: 0; gap: 0; padding: 8px 10px; }
  .a-top #prt svg { width: 20px !important; height: 20px !important; }
}
