/* BS Pharma CRM — هوية بصرية
   حبر الشريط الجانبي: أخضر معملي غامق (ورقة اللوجو)، الكريمزون للعلامة فقط،
   الألوان الدلالية محجوزة لحالات التسجيل. */

/* نفس خطوط ثيم أودو: San Francisco على الماك، Inter على غيره — والعربي Arial، وNoto Naskh على الأجهزة اللي مفيهاش Arial */
@font-face { font-family: "BS Inter"; font-weight: 400; font-display: swap; src: url("vendor/fonts/inter-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: "BS Naskh Arabic"; font-weight: 400; font-display: swap; src: url("vendor/fonts/noto-naskh-arabic-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; }
@font-face { font-family: "BS Inter"; font-weight: 500; font-display: swap; src: url("vendor/fonts/inter-latin-500-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: "BS Naskh Arabic"; font-weight: 500; font-display: swap; src: url("vendor/fonts/noto-naskh-arabic-arabic-500-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; }
@font-face { font-family: "BS Inter"; font-weight: 600; font-display: swap; src: url("vendor/fonts/inter-latin-600-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: "BS Naskh Arabic"; font-weight: 600; font-display: swap; src: url("vendor/fonts/noto-naskh-arabic-arabic-600-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; }
@font-face { font-family: "BS Inter"; font-weight: 700; font-display: swap; src: url("vendor/fonts/inter-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: "BS Naskh Arabic"; font-weight: 700; font-display: swap; src: url("vendor/fonts/noto-naskh-arabic-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; }

:root {
  /* ألوان ثيم B.S Pharma في أودو */
  --sidebar: #3A4756;      /* الشريط الجانبي (Slate) */
  --sidebar-text: #F4F1EC;
  --sidebar-muted: #AEB8C4;
  --ink: #3A4756;          /* العناوين */
  --ink-2: #2E3946;
  --leaf: #8B1538;         /* الإجراء الأساسي = Deep Crimson */
  --leaf-dark: #6F102C;
  --leaf-soft: #F5E7EB;
  --crimson: #8B1538;
  --logo-crimson: #C42D5A; /* كريمزون اللوجو للتفاصيل على الخلفية الغامقة */
  --gold: #D4B483;
  --paper: #FAF7F2;        /* Ivory */
  --surface: #ffffff;
  --line: #E7E1D8;
  --soft: #F6F1EA;
  --muted: #6B7280;
  --text: #1F1F1F;
  --ok: #2F7D5B;           /* سارية / معتمد */

  --bs-body-font-family: -apple-system, BlinkMacSystemFont, "BS Inter", Arial, "BS Naskh Arabic", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--text);
  --bs-border-color: var(--line);
  --bs-link-color: var(--crimson);
  --bs-link-color-rgb: 139, 21, 56;
  --bs-link-hover-color: var(--leaf-dark);
  --bs-link-hover-color-rgb: 111, 16, 44;
  --bs-primary: var(--crimson);
  --bs-primary-rgb: 139, 21, 56;
}

body { font-size: 0.95rem; line-height: 1.6; font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .page-head h1 { letter-spacing: 0; }
.num, td.num, .ltr { direction: ltr; unicode-bidi: isolate; }
dd.num, td.num { text-align: right; }
.ltr { display: inline-block; }

/* أزرار */
.btn-primary { --bs-btn-bg: var(--leaf); --bs-btn-border-color: var(--leaf); --bs-btn-hover-bg: var(--leaf-dark);
  --bs-btn-hover-border-color: var(--leaf-dark); --bs-btn-active-bg: var(--leaf-dark); --bs-btn-active-border-color: var(--leaf-dark);
  --bs-btn-disabled-bg: var(--leaf); --bs-btn-disabled-border-color: var(--leaf); }
.btn-outline-primary { --bs-btn-color: var(--leaf); --bs-btn-border-color: var(--leaf); --bs-btn-hover-bg: var(--leaf);
  --bs-btn-hover-border-color: var(--leaf); --bs-btn-active-bg: var(--leaf-dark); }
.btn-whatsapp { --bs-btn-color: #fff; --bs-btn-bg: #1f9d55; --bs-btn-border-color: #1f9d55;
  --bs-btn-hover-bg: #178046; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #178046; }
.btn { border-radius: 8px; font-weight: 500; }
.form-control, .form-select { border-radius: 7px; background-color: #fff; }
.form-control[type="url"], .form-control[type="email"], input[name$="phone"], input[name="whatsapp"] { direction: ltr; text-align: right; }
.form-control:focus, .form-select:focus, .btn:focus-visible { border-color: var(--leaf); box-shadow: 0 0 0 .2rem rgba(139,21,56,.18); }
a { text-decoration: none; }

/* الهيكل */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--sidebar); color: var(--sidebar-text); border-inline-end: 1px solid rgba(255,255,255,.06); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: block; padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: .4rem; }
.brand img { display: block; width: 100%; height: auto; max-height: 64px; object-fit: contain; }
.nav-group { padding: .35rem .7rem; }
.nav-group-title { font-size: .74rem; color: var(--sidebar-muted); padding: .55rem .5rem .25rem; }
.side-link { display: flex; align-items: center; gap: .65rem; color: var(--sidebar-text); padding: .45rem .6rem; border-radius: 8px; margin-bottom: 1px; position: relative; }
.side-link i { font-size: 1.05rem; opacity: .85; }
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.side-link.active::before { content: ""; position: absolute; inset-inline-start: -0.7rem; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--gold); }
.side-link .count { margin-inline-start: auto; font-size: .72rem; background: var(--logo-crimson); color: #fff; border-radius: 10px; padding: 0 .45rem; }
.sidebar-foot { margin-top: auto; padding: .8rem 1rem 1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
.sidebar-foot a { color: var(--sidebar-muted); }

.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.6rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar form { flex: 1; max-width: 520px; }
.topbar .form-control { background: var(--paper); border-color: transparent; }
.content { padding: 1.4rem 1.6rem 3rem; max-width: 1400px; }
.menu-toggle { display: none; }

@media (max-width: 991px) {
  .sidebar { position: fixed; inset-inline-start: 0; z-index: 50; transform: translateX(100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .menu-toggle { display: inline-flex; }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
}

/* عناوين الصفحات */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; margin-bottom: 1.2rem; }
.page-head h1 { font-size: 1.55rem; font-weight: 700; color: var(--ink); margin: 0; }
.page-head .sub { color: var(--muted); font-size: .9rem; margin-top: .15rem; }
.page-head .actions { margin-inline-start: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* لوحات */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.panel-head { display: flex; align-items: center; gap: .5rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1rem; font-weight: 600; margin: 0; color: var(--ink); }
.panel-head .more { margin-inline-start: auto; font-size: .85rem; }
.panel-body { padding: 1rem; }
.panel-list { list-style: none; margin: 0; padding: 0; }
.panel-list > li { padding: .65rem 1rem; border-bottom: 1px solid #EFEAE2; }
.panel-list > li:last-child { border-bottom: 0; }
.empty { color: var(--muted); padding: 1.4rem 1rem; text-align: center; font-size: .9rem; }

/* أرقام الرئيسية: شريط واحد مش كروت متكررة */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stat-strip a { padding: .8rem 1rem; color: var(--text); border-inline-start: 1px solid var(--line); }
.stat-strip a:first-child { border-inline-start: 0; }
.stat-strip a:hover { background: var(--soft); }
.stat-strip .v { font-size: 1.6rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.stat-strip .l { font-size: .82rem; color: var(--muted); }
.stat-strip .warn .v { color: #b26b00; }
.stat-strip .bad .v { color: #b42318; }

/* مسار الـ ١٠٠ يوم — العنصر المميز في الرئيسية */
.runway { background: var(--sidebar); color: var(--sidebar-text); border-radius: 14px; padding: 1.1rem 1.2rem 1.3rem; }
.runway h2 { font-size: 1.05rem; font-weight: 600; margin: 0; color: #fff; }
.runway .hint { color: var(--sidebar-muted); font-size: .85rem; }
.track { position: relative; height: 72px; margin: 1.6rem .4rem .4rem; }
.track-line { position: absolute; inset-inline: 0; top: 38px; height: 4px; border-radius: 4px;
  background: linear-gradient(to left, #e2546b 0%, #e2a03f 35%, #3aa58b 100%); }
.track-tick { position: absolute; top: 48px; font-size: .72rem; color: var(--sidebar-muted); transform: translateX(50%); white-space: nowrap; }
.track-tick:first-of-type { transform: none; }
.track-tick:last-of-type { transform: translateX(100%); }
.track-dot { position: absolute; top: 31px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--sidebar); transform: translateX(50%); cursor: pointer; }
.track-dot.lvl-1 { background: #e2546b; } .track-dot.lvl-2 { background: #e2a03f; } .track-dot.lvl-3 { background: #3aa58b; }
.track-dot.stack-1 { top: 12px; } .track-dot.stack-2 { top: -7px; }
.track-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.runway-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .4rem .9rem; margin-top: .6rem; }
.runway-list a { color: var(--sidebar-text); display: flex; gap: .5rem; align-items: baseline; font-size: .88rem; padding: .2rem 0; border-bottom: 1px dashed rgba(255,255,255,.12); }
.runway-list a:hover { color: #fff; }
.runway-list .d { margin-inline-start: auto; font-weight: 600; white-space: nowrap; }
.runway-list .d.lvl-1 { color: #ff8c9c; } .runway-list .d.lvl-2 { color: #f2c46b; } .runway-list .d.lvl-3 { color: #8fd8c4; }

/* حالات التسجيل */
.reg-badge { font-weight: 500; font-size: .78rem; }
.reg-expiring { color: #5a3b00 !important; }

/* ملف العميل */
.client-hero { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.3rem; margin-bottom: 1rem; }
.client-hero h1 { font-size: 1.7rem; font-weight: 700; color: var(--ink); margin: 0; }
.client-hero .kind { font-size: .8rem; padding: .15rem .6rem; border-radius: 20px; background: var(--leaf-soft); color: var(--crimson); font-weight: 600; }
.client-hero .kind.prospect { background: #fff1d6; color: #7a4d00; }
.meta-row { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; color: var(--muted); font-size: .9rem; margin-top: .5rem; }
.meta-row i { color: var(--muted); margin-inline-end: .25rem; }
.avatars { display: flex; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--leaf-soft); color: var(--crimson); display: grid; place-items: center; font-size: .75rem; font-weight: 700; border: 2px solid #fff; margin-inline-start: -6px; }
.avatars .avatar:first-child { margin-inline-start: 0; }

.nav-tabs-crm { border-bottom: 1px solid var(--line); gap: .2rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.nav-tabs-crm .nav-link { border: 0; color: var(--muted); padding: .55rem .9rem; border-bottom: 2px solid transparent; border-radius: 0; white-space: nowrap; font-weight: 500; }
.nav-tabs-crm .nav-link.active { color: var(--ink); border-bottom-color: var(--leaf); background: transparent; font-weight: 600; }
.nav-tabs-crm .nav-link .c { font-size: .72rem; background: #EEE8DF; color: var(--muted); border-radius: 10px; padding: 0 .4rem; margin-inline-start: .3rem; }
.nav-tabs-crm .nav-link .c.hot { background: #fde8e8; color: #b42318; }

/* جدول */
.table-crm { --bs-table-bg: transparent; margin: 0; }
.table-crm thead th { font-size: .8rem; color: var(--muted); font-weight: 600; background: #F8F5EF; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-crm td { vertical-align: middle; border-color: #EFEAE2; }
.table-crm tbody tr:hover { background: #FBF8F3; }
.old-name { font-size: .8rem; color: var(--muted); }
.old-name::before { content: "الاسم القديم: "; color: #a3162e; }

/* الخط الزمني */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid #EFEAE2; }
.timeline .ic { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; display: grid; place-items: center; background: var(--leaf-soft); color: var(--crimson); }
.timeline .ic.whatsapp { background: #dcf5e6; color: #1f9d55; }
.timeline .ic.note { background: #f1f1ef; color: #6b6b66; }
.timeline .who { font-size: .8rem; color: var(--muted); }
.timeline .txt { white-space: pre-line; }

/* العبوات */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: .8rem; }
.pack-actions { display: flex; flex-wrap: wrap; gap: .3rem; padding: 0 .5rem .5rem; }
.pack-actions .btn { white-space: nowrap; }
.pack { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.pack.approved { border: 2px solid var(--ok); }
.pack .thumb { height: 140px; background: #F3EFE8; display: grid; place-items: center; color: #9aa8a5; font-size: 2.2rem; }
.pack .thumb img { max-width: 100%; max-height: 140px; object-fit: contain; }
.pack .body { padding: .55rem .7rem; font-size: .85rem; flex: 1; }
.pack .ribbon { background: var(--ok); color: #fff; font-size: .75rem; padding: .15rem .6rem; font-weight: 600; }
.pack.superseded { opacity: .6; }

/* لوحة المحتملين */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: .8rem; }
.board-col { background: #F1ECE4; border-radius: 12px; display: flex; flex-direction: column; min-height: 60vh; }
.board-col-head { padding: .7rem .8rem; display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ink); }
.board-col-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.board-col-head .n { margin-inline-start: auto; font-size: .8rem; color: var(--muted); font-weight: 500; }
.board-cards { padding: 0 .55rem .7rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; min-height: 80px; }
.board-card { background: #fff; border-radius: 9px; padding: .6rem .7rem; border: 1px solid var(--line); cursor: grab; }
.board-card:active { cursor: grabbing; }
.board-card .t { font-weight: 600; color: var(--ink); }
.board-card .m { font-size: .8rem; color: var(--muted); }
.board-card.stale .m .last { color: #b42318; font-weight: 600; }
.sortable-ghost { opacity: .35; }

/* ملاحظات */
.flag { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; padding: .1rem .5rem; border-radius: 6px; background: #F1ECE4; color: var(--muted); }
.flag.high { background: #fde8e8; color: #b42318; }
.flag.over { background: #fde8e8; color: #b42318; }
.flag.today { background: #fff1d6; color: #7a4d00; }
.text-ink { color: var(--ink) !important; }
.small-muted { font-size: .82rem; color: var(--muted); }
.big-days { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.reg-card { border-radius: 12px; padding: 1rem 1.1rem; border: 1px solid var(--line); background: #fff; }
.reg-card.st-expired { border-inline-start: 5px solid #b42318; }
.reg-card.st-expiring { border-inline-start: 5px solid #d08a00; }
.reg-card.st-valid { border-inline-start: 5px solid var(--ok); }
.reg-card.st-applied, .reg-card.st-renewal { border-inline-start: 5px solid #2f6fb3; }
.reg-card.st-trial { border-inline-start: 5px solid #8a9592; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; font-size: .9rem; }
dl.facts dt { color: var(--muted); font-weight: 500; }
dl.facts dd { margin: 0; }
.specs-text { white-space: pre-line; background: #F8F5EF; border-radius: 8px; padding: .8rem 1rem; border: 1px solid #EFEAE2; }

/* نماذج */
.form-shell { max-width: 860px; }
.form-label { font-weight: 500; font-size: .88rem; margin-bottom: .25rem; }
.form-text { font-size: .78rem; }
.team-checks { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.team-checks label { display: inline-flex; align-items: center; gap: .35rem; font-weight: 400; }
.errorlist { list-style: none; padding: 0; margin: .2rem 0 0; color: #b42318; font-size: .82rem; }

/* تسجيل الدخول */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--sidebar); color: var(--sidebar-text); padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.login-side h1 { font-size: 2.2rem; font-weight: 700; color: #fff; line-height: 1.3; max-width: 14ch; }
.login-logo { width: 260px; max-width: 70%; height: auto; }
.login-mark { width: 120px; opacity: .9; }
.login-form { display: grid; place-items: center; padding: 2rem; }
.login-form .box { width: 100%; max-width: 360px; }
@media (max-width: 800px) { .login-wrap { grid-template-columns: 1fr; } .login-side { padding: 1.5rem; } .login-side h1 { font-size: 1.5rem; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .sidebar, .topbar, .actions, .btn { display: none !important; } .content { padding: 0; } }

.brand .app-name { display: block; margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(255,255,255,.08); color: var(--sidebar-text); font-weight: 600; font-size: .86rem; letter-spacing: .01em; direction: ltr; text-align: right; opacity: .92; }
.login-app-name { font-weight: 600; color: var(--sidebar-text); font-size: 1.05rem; margin-top: 14px; direction: ltr; text-align: right; }

/* ---------- لوجو العميل والفريق ---------- */
.client-logo { width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--line); background: #fff; object-fit: contain; padding: 4px; flex: none; }
.team-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.team-list li { display: flex; align-items: center; gap: .55rem; }
.team-all { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--leaf); background: var(--leaf-soft); padding: .15rem .6rem; border-radius: 999px; font-weight: 600; }
.wa-card { display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: 12px; background: #EAF7EF; border: 1px solid #CDEBD7; color: var(--text); }
.wa-card:hover { background: #DDF2E5; color: var(--text); }
.wa-card .wa-ico { width: 40px; height: 40px; font-size: 1.35rem; }
.wa-card .wa-link { display: block; direction: ltr; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--muted); }
.wa-card .wa-open { flex: none; font-weight: 600; color: var(--wa-dark); font-size: .9rem; }
.init-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; padding: .1rem .55rem; border-radius: 6px; background: #EEF1F5; color: var(--ink); }

/* ---------- أرشيف ملفات العميل ---------- */
.files-company { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.file-box { border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; flex-direction: column; min-height: 140px; }
.file-box > header { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.file-box > header h3 { font-size: .95rem; font-weight: 700; margin: 0; flex: 1; color: var(--ink); }
.file-box > header .c { font-size: .75rem; color: var(--muted); }
.file-list { list-style: none; margin: 0; padding: .3rem .5rem .5rem; display: flex; flex-direction: column; gap: .15rem; }
.file-item { display: flex; align-items: center; gap: .55rem; padding: .3rem .3rem; border-radius: 8px; }
.file-item:hover { background: var(--soft); }
.file-item .ft { width: 42px; height: 42px; border-radius: 8px; background: #F3EFE8; display: grid; place-items: center; color: var(--muted); font-size: 1.3rem; flex: none; overflow: hidden; }
.file-item .ft img { width: 100%; height: 100%; object-fit: cover; }
.file-item .fn { flex: 1; min-width: 0; }
.file-item .fn a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-item .fm { font-size: .75rem; color: var(--muted); }
.file-item form { opacity: 0; transition: opacity .15s; }
.file-item:hover form, .file-item:focus-within form { opacity: 1; }
.file-empty { color: var(--muted); font-size: .85rem; padding: .6rem .8rem; }
.photo-strip { display: flex; flex-wrap: wrap; gap: .4rem; padding: .3rem .8rem .7rem; }
.photo-strip a { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); display: block; background: #F3EFE8; }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; }

.folder { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: .7rem; }
.folder > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .75rem 1rem; }
.folder > summary::-webkit-details-marker { display: none; }
.folder > summary .chev { transition: transform .15s; color: var(--muted); }
.folder[open] > summary .chev { transform: rotate(-90deg); }
.folder[open] > summary { border-bottom: 1px solid var(--line); }
.folder .pname { font-weight: 700; color: var(--text); }
.folder .chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-inline-start: auto; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; padding: .1rem .5rem; border-radius: 6px; background: #F1ECE4; color: var(--muted); }
.chip.ok { background: #E3F2EA; color: var(--ok); }
.chip.wait { background: #FFF1D6; color: #7a4d00; }
.folder-body { display: grid; grid-template-columns: repeat(3, 1fr); }
.folder-body > section { border-inline-start: 1px solid var(--line); min-width: 0; }
.folder-body > section:first-child { border-inline-start: 0; }
.folder-body h4 { font-size: .9rem; font-weight: 700; color: var(--ink); margin: 0; display: flex; align-items: center; gap: .4rem; padding: .7rem .8rem .3rem; }
.folder-body h4 .more { margin-inline-start: auto; font-weight: 500; font-size: .8rem; }
.folder-foot { border-top: 1px solid var(--line); padding: .3rem 0; }
.folder-foot h4 { font-size: .85rem; }
.reg-mini { padding: .2rem .8rem .6rem; font-size: .85rem; }
.reg-mini dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; margin: .4rem 0 0; }
.reg-mini dt { color: var(--muted); font-weight: 400; }
.reg-mini dd { margin: 0; }
.pack-row { display: flex; gap: .55rem; align-items: flex-start; padding: .35rem .3rem; border-radius: 8px; }
.pack-row:hover { background: var(--soft); }
.pack-row .ft { width: 52px; height: 52px; border-radius: 8px; background: #F3EFE8; display: grid; place-items: center; color: var(--muted); font-size: 1.3rem; flex: none; overflow: hidden; border: 1px solid var(--line); }
.pack-row.approved .ft { border: 2px solid var(--ok); }
.pack-row .ft img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pack-row .pb { flex: 1; min-width: 0; font-size: .85rem; }
.pack-row .pb .t { font-weight: 600; }
.pack-row .acts { display: flex; gap: .2rem; flex-wrap: wrap; margin-top: .25rem; }
.pack-row .acts .btn { padding: .05rem .4rem; font-size: .75rem; }
@media (max-width: 991px) { .folder-body { grid-template-columns: 1fr; } .folder-body > section { border-inline-start: 0; border-top: 1px solid var(--line); } .folder-body > section:first-child { border-top: 0; } }

/* ---------- متابعة المشكلة / الطلب ---------- */
.ticket-head .flag { font-size: .85rem; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li { position: relative; padding: .7rem 1rem .7rem 1rem; border-bottom: 1px solid var(--line); }
.note-list li:last-child { border-bottom: 0; }
.note-list .who { font-size: .8rem; color: var(--muted); }
.note-list .chg { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; background: #EEF1F5; color: var(--ink); padding: .05rem .5rem; border-radius: 6px; }
.status-pick { display: flex; flex-wrap: wrap; gap: .35rem; }
.status-pick input { display: none; }
.status-pick label { border: 1px solid var(--line); border-radius: 999px; padding: .2rem .75rem; font-size: .85rem; cursor: pointer; background: #fff; }
.status-pick input:checked + label { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.status-pick input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }
.req-flag-to_issue { background: #FDE2C8 !important; color: #8a3b00 !important; }
.req-flag-new { background: #E4ECF7 !important; color: #234 !important; }
.req-flag-done { background: #E3F2EA !important; color: var(--ok) !important; }

/* ---------- تصدير ---------- */
.sheet-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.sheet-checks label { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; background: #fff; cursor: pointer; }
.sheet-checks label:has(input:checked) { border-color: var(--leaf); background: var(--leaf-soft); }

/* ---------- واتساب ---------- */
:root { --wa: #25D366; --wa-dark: #157F44; --wa-darker: #106636; }
.wa-ico { width: 46px; height: 46px; border-radius: 50%; background: var(--wa); color: #fff; display: grid; place-items: center; font-size: 1.6rem; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.28); }
.wa-hero { display: flex; align-items: center; gap: .75rem; min-width: 270px; padding: .55rem .7rem; padding-inline-end: 1.1rem; border-radius: 16px; border: 0;
  background: var(--wa-dark); color: #fff; text-align: start; box-shadow: 0 8px 20px rgba(21,127,68,.28); transition: background .15s ease, transform .15s ease; }
.wa-hero:hover { background: var(--wa-darker); color: #fff; transform: translateY(-1px); }
.wa-hero:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.wa-hero .wa-txt { display: flex; flex-direction: column; line-height: 1.25; flex: 1; }
.wa-hero .wa-txt b { font-size: 1.15rem; font-weight: 700; }
.wa-hero .wa-txt small { font-size: .82rem; opacity: .92; }
.wa-hero .wa-out { font-size: 1rem; opacity: .85; }
.wa-hero.empty { background: #EAF7EF; color: var(--wa-dark); box-shadow: none; border: 2px dashed #9ED9B4; }
.wa-hero.empty:hover { background: #DDF2E5; }
.wa-dot { width: 36px; height: 36px; border-radius: 50%; background: var(--wa); color: #fff; display: inline-grid; place-items: center; font-size: 1.15rem; vertical-align: middle; transition: transform .15s ease, background .15s ease; }
.wa-dot:hover { background: #1EBE5B; color: #fff; transform: scale(1.06); }
.wa-dot.sm { width: 28px; height: 28px; font-size: .95rem; }
.wa-fab { position: fixed; bottom: 22px; inset-inline-end: 24px; z-index: 1030; display: flex; align-items: center; gap: .6rem;
  padding: 6px; padding-inline-end: 6px; border-radius: 999px; background: var(--wa-dark); color: #fff; box-shadow: 0 10px 26px rgba(16,102,54,.35); transition: padding .2s ease, background .15s ease; }
.wa-fab-ico { width: 54px; height: 54px; border-radius: 50%; background: var(--wa); display: grid; place-items: center; font-size: 1.85rem; flex: none; }
.wa-fab-label { font-weight: 700; white-space: nowrap; max-width: 0; overflow: hidden; transition: max-width .25s ease; }
.wa-fab:hover, .wa-fab:focus-visible { background: var(--wa-darker); color: #fff; padding-inline-end: 1.1rem; }
.wa-fab:hover .wa-fab-label, .wa-fab:focus-visible .wa-fab-label { max-width: 260px; }
.wa-fab:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.wa-fab-space { height: 70px; }
@media (max-width: 575px) { .wa-hero { min-width: 0; width: 100%; } .wa-fab { bottom: 16px; inset-inline-end: 16px; } .wa-fab-ico { width: 50px; height: 50px; } }
@media (prefers-reduced-motion: reduce) { .wa-hero, .wa-fab, .wa-fab-label, .wa-dot { transition: none; } .wa-hero:hover { transform: none; } }

.reg-req { background: #FDE2C8; color: #8a3b00; }

/* ---------- لوجو العميل (قابل للتغيير) ---------- */
.logo-btn { position: relative; padding: 0; border: 0; background: none; border-radius: 12px; flex: none; }
.logo-btn .client-logo { display: block; }
.logo-btn .logo-edit { position: absolute; bottom: -6px; inset-inline-start: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--leaf); color: #fff; display: grid; place-items: center; font-size: .75rem; box-shadow: 0 2px 6px rgba(0,0,0,.18); opacity: 0; transition: opacity .15s ease; }
.logo-btn:hover .logo-edit, .logo-btn:focus-visible .logo-edit { opacity: 1; }
.logo-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.logo-btn.empty .client-logo { place-items: center; align-content: center; gap: 2px; color: var(--muted); border-style: dashed; font-size: 1.3rem; background: var(--soft); }
.logo-btn.empty .client-logo small { font-size: .7rem; }
.logo-btn.empty:hover .client-logo { color: var(--leaf); border-color: var(--leaf); }
.logo-preview { border: 1px solid var(--line); border-radius: 12px; background: #fff; display: grid; place-items: center; padding: 1rem; min-height: 160px; }
.logo-preview img { max-width: 100%; max-height: 220px; object-fit: contain; }
@media (hover: none) { .logo-btn .logo-edit { opacity: 1; } }

/* ---------- بيانات الشركة ---------- */
.company-contact { display: flex; flex-direction: column; gap: .2rem; margin-top: .7rem; padding-top: .6rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .78rem; direction: ltr; text-align: right; }
.company-contact a { color: var(--sidebar-muted); }
.company-contact a:hover { color: var(--sidebar-text); }
.company-contact i { margin-inline-end: .3rem; }

/* ---------- التقارير والإضافات ---------- */
.bar { height: 8px; border-radius: 99px; background: #F1ECE4; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--leaf); border-radius: 99px; }
.quick-wrap { max-width: 560px; margin-inline: auto; }
.chip.bad { background: #fde8e8; color: #b42318; }
.needs-update { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; padding: .1rem .5rem; border-radius: 6px; background: #fde8e8; color: #b42318; font-weight: 600; }
.doc-exp { font-size: .72rem; padding: 0 .4rem; border-radius: 5px; background: #F1ECE4; color: var(--muted); white-space: nowrap; }
.doc-exp.soon { background: #fff1d6; color: #7a4d00; }
.doc-exp.gone { background: #fde8e8; color: #b42318; }
.msg-preview { white-space: pre-wrap; font-size: .95rem; background: #EAF7EF; border: 1px solid #CDEBD7; border-radius: 12px; padding: .8rem 1rem; min-height: 140px; }

/* ---------- بيانات المعارض والسوق ---------- */
.market-filters { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.market-filters .form-control, .market-filters .form-select { width: auto; min-width: 140px; flex: 1 1 140px; max-width: 220px; }
.promo-bar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; background: #FBF8F3; }
.promo-count { display: inline-flex; align-items: center; gap: .35rem; font-size: .95rem; }
.promo-count .bi-whatsapp { color: #1E9E55; }
.mc-thumb { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--leaf-soft); color: var(--leaf); font-weight: 700; border: 1px solid var(--line); }
.mc-thumb img { width: 100%; height: 100%; object-fit: cover; }
tr.opted-out td { opacity: .6; }
.mc-photos { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.mc-photos figure { margin: 0; }
.mc-photos img, .mc-empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #F3EFE8; }
.mc-empty { display: grid; place-items: center; font-size: 2rem; color: var(--muted); }
.mc-photos figcaption { font-size: .8rem; color: var(--muted); text-align: center; margin-top: .3rem; }
.cam-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; border: 2px dashed var(--line); border-radius: 12px; padding: .8rem; background: #fff; color: var(--ink); cursor: pointer; text-align: center; min-height: 92px; }
.cam-btn i { font-size: 1.6rem; color: var(--leaf); }
.cam-btn.has-file { border-color: var(--ok); background: #EEF7F1; }
.cam-btn input { display: none; }
.cam-btn .fname { font-size: .72rem; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- معرض الملفات ---------- */
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
.gal-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.gal-card.hidden-file { opacity: .55; }
.gal-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #F3EFE8; border-bottom: 1px solid var(--line); text-decoration: none; }
.gal-thumb img { width: 100%; height: 100%; object-fit: contain; padding: .5rem; }
.gal-ico { display: flex; flex-direction: column; align-items: center; gap: .25rem; color: var(--ink); }
.gal-ico i { font-size: 2.4rem; }
.gal-ico b { font-size: .7rem; letter-spacing: .05em; color: var(--muted); }
.gal-body { padding: .55rem .7rem .4rem; flex: 1; }
.gal-body h3 { font-size: .92rem; font-weight: 700; margin: 0 0 .15rem; color: var(--text); }
.gal-body p { font-size: .8rem; color: var(--muted); margin: 0 0 .25rem; }
.gal-meta { display: flex; flex-wrap: wrap; gap: .25rem .6rem; font-size: .72rem; color: var(--muted); }
.gal-actions { position: absolute; top: .4rem; inset-inline-start: .4rem; display: flex; gap: .25rem; opacity: 0; transition: opacity .15s; }
.gal-card:hover .gal-actions, .gal-card:focus-within .gal-actions { opacity: 1; }
.gal-actions .btn { background: rgba(255,255,255,.94); border: 1px solid var(--line); padding: .15rem .45rem; }
@media (hover: none) { .gal-actions { opacity: 1; } }
.gal-empty { color: var(--muted); font-size: .88rem; padding: .3rem 0; }
.send-row { display: flex; align-items: center; gap: .6rem; }
.send-row > i { color: var(--muted); }

.gs-group { margin-bottom: 1rem; }
.gs-group legend { display: flex; align-items: center; gap: .6rem; font-size: .9rem; font-weight: 700; color: var(--ink); margin-bottom: .45rem; float: none; width: auto; }
.gs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .55rem; }
.gs-tile { position: relative; display: flex; flex-direction: column; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; }
.gs-tile input { position: absolute; opacity: 0; pointer-events: none; }
.gs-thumb { display: grid; place-items: center; aspect-ratio: 1; background: #F3EFE8; color: var(--ink); }
.gs-thumb img { width: 100%; height: 100%; object-fit: contain; padding: .3rem; }
.gs-thumb i { font-size: 1.8rem; }
.gs-thumb b { font-size: .65rem; color: var(--muted); }
.gs-name { font-size: .78rem; padding: .3rem .4rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gs-check { position: absolute; top: .3rem; inset-inline-end: .3rem; color: var(--leaf); font-size: 1.15rem; background: #fff; border-radius: 50%; opacity: 0; }
.gs-tile:has(input:checked) { border-color: var(--leaf); background: var(--leaf-soft); }
.gs-tile:has(input:checked) .gs-check { opacity: 1; }
.gs-tile:has(input:focus-visible) { outline: 3px solid rgba(139,21,56,.35); outline-offset: 1px; }
.gs-email { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: .4rem; }
.gs-footer { gap: .5rem; }
.gs-status { color: var(--ok); }

/* ---------- الطباعة ---------- */
.po-kind { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.po-kind-label { font-weight: 700; color: var(--ink); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg-opt { position: relative; margin: 0; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: block; padding: .45rem 1rem; font-weight: 600; color: var(--muted); border-inline-start: 1px solid var(--line); }
.seg-opt:first-child span { border-inline-start: 0; }
.seg-opt input:checked + span { background: var(--ink); color: #fff; }
.seg-opt input:focus-visible + span { outline: 3px solid rgba(139,21,56,.35); outline-offset: -3px; }
.po-step .panel-head h2 { font-size: 1.02rem; }
.po-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8rem; font-weight: 700; flex: none; }
.po-sub { font-weight: 600; color: var(--ink); font-size: .9rem; margin-bottom: .45rem; }
.po-note { background: var(--soft); border: 1px dashed var(--line); border-radius: 10px; padding: .7rem .9rem; font-size: .9rem; color: var(--muted); }
.po-files-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .6rem; }
.po-files-bar input[type=search] { max-width: 320px; }
.po-files-bar label { display: inline-flex; align-items: center; gap: .35rem; }
.po-designs .po-tile { text-align: start; padding: 0; font: inherit; }
.po-tile.on { border-color: var(--leaf); background: var(--leaf-soft); }
.po-tile.on .gs-check { opacity: 1; }
.po-tile:focus-visible { outline: 3px solid rgba(139,21,56,.35); outline-offset: 1px; }
.po-picked { margin: .4rem 0 0; padding-inline-start: 1.1rem; color: var(--muted); }
.po-existing { list-style: none; padding: 0; margin: 0; }
.po-existing li { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid #EFEAE2; }
.po-existing label { display: inline-flex; gap: .3rem; align-items: center; }
.po-line { display: grid; grid-template-columns: minmax(200px, 2.2fr) minmax(150px, 1.6fr) 1fr 1fr .9fr 1fr 40px; gap: .45rem; align-items: start; padding: .5rem 0; border-bottom: 1px solid #EFEAE2; }
.po-line-head { font-size: .78rem; color: var(--muted); font-weight: 600; padding-top: 0; }
.po-form:not(.is-montage) .po-montage { display: none; }
.po-form:not(.is-montage) .po-line { grid-template-columns: minmax(200px, 2.2fr) minmax(150px, 1.6fr) 1fr 1fr 1fr 40px; }
.po-lbl { display: none; font-size: .75rem; color: var(--muted); margin-bottom: .15rem; }
.po-line.flash { background: var(--leaf-soft); transition: background .3s; }
.po-line.has-error { background: #fff7f7; }
.po-line-err { grid-column: 1 / -1; }
.po-search.is-invalid { border-color: #b42318; }
.po-total { font-size: .95rem; color: var(--ink); }
.opt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.opt-card { position: relative; margin: 0; cursor: pointer; }
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.opt-card span { display: block; height: 100%; padding: .6rem .8rem; border: 2px solid var(--line); border-radius: 10px; background: #fff; font-weight: 600; color: var(--ink); }
.opt-card input:checked + span { border-color: var(--leaf); background: var(--leaf-soft); color: var(--leaf-dark); }
.opt-card input:focus-visible + span { outline: 3px solid rgba(139,21,56,.35); outline-offset: 1px; }
.po-montage-box { background: var(--soft); border-radius: 10px; padding: .7rem .9rem; }
.po-montage-box input { max-width: 160px; }
@media (max-width: 991px) {
  .po-line, .po-form:not(.is-montage) .po-line { grid-template-columns: 1fr 1fr; gap: .4rem .6rem; padding: .7rem 0; }
  .po-line-head { display: none; }
  .po-lbl { display: block; }
  .po-cell-product { grid-column: 1 / -1; }
  .po-cell-x { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
}
@media (max-width: 575px) {
  .po-kind .seg { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .seg-opt span { height: 100%; display: grid; place-items: center; text-align: center; padding: .45rem .35rem; font-size: .85rem; line-height: 1.3; }
}
@media (prefers-reduced-motion: reduce) { .po-line.flash { transition: none; } }

/* حالة أمر الطباعة */
.po-status { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600; padding: .12rem .55rem; border-radius: 6px; white-space: nowrap; }
.po-status.draft { background: #F1ECE4; color: var(--muted); }
.po-status.sent { background: #E6EDF5; color: #2B4C73; }
.po-status.late { background: #fde8e8; color: #b42318; }
.po-status.delivered { background: #E3F2EA; color: var(--ok); }
.po-items { margin: 0; padding: 0; list-style: none; font-size: .88rem; }
.po-items li { line-height: 1.45; }
.po-send-card { border: 2px solid var(--leaf); }
.po-msg { white-space: pre-wrap; font-size: .88rem; background: var(--soft); border-radius: 10px; padding: .75rem .9rem; max-height: 320px; overflow: auto; margin: 0; font-family: inherit; }
.po-file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.po-file { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; color: inherit; text-decoration: none; }
.po-file .gs-thumb { aspect-ratio: 4/3; }
.po-file .gs-name { font-size: .8rem; }
.printer-services { display: flex; flex-wrap: wrap; gap: .3rem; }

/* ---------------------------------------------------------------------------
   متابعة المستخدمين + طلبات التصدير
   --------------------------------------------------------------------------- */
.notice-bar { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; margin-bottom: 1rem; border-radius: 10px;
  background: #FFF4E0; border: 1px solid #F0D9A8; color: #6B4500; font-weight: 600; text-decoration: none; }
.notice-bar:hover { background: #FFEDCC; color: #6B4500; }
.notice-bar .bi { font-size: 1.15rem; }
.notice-bar b { margin-inline-start: auto; color: var(--crimson); white-space: nowrap; }
.notice-bar.ok { background: #E8F4EE; border-color: #BFE0CF; color: #1F5A40; }
.side-link .count.count-ok { background: var(--ok); }

.period-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.seg-links a { display: block; padding: .38rem .85rem; font-weight: 600; font-size: .88rem; color: var(--muted); border-inline-start: 1px solid var(--line); text-decoration: none; }
.seg-links a:first-child { border-inline-start: 0; }
.seg-links a:hover { background: var(--soft); color: var(--ink); }
.seg-links a.on { background: var(--ink); color: #fff; }
.period-custom { display: flex; gap: .35rem; align-items: center; font-size: .85rem; color: var(--muted); }
.period-custom label { display: inline-flex; align-items: center; gap: .3rem; }
.period-custom input { width: 9.2rem; }

.avatar { flex: none; position: relative; display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: #E9E3D9; color: var(--ink); font-weight: 700; font-size: .85rem; }
.avatar.sm { width: 1.7rem; height: 1.7rem; font-size: .7rem; }
.avatar.lg { width: 3.1rem; height: 3.1rem; font-size: 1.1rem; }
.avatar.is-online::after { content: ""; position: absolute; inset-block-end: 0; inset-inline-end: 0; width: .7rem; height: .7rem;
  border-radius: 50%; background: #2DB36F; border: 2px solid #fff; }
.who { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; }
.who:hover .fw-semibold { color: var(--crimson); }
.who.big h1 { margin: 0; }

.online-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; padding: .6rem .9rem; margin-bottom: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.online-title { font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: .4rem; margin-inline-end: .3rem; }
.live-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #2DB36F; box-shadow: 0 0 0 0 rgba(45,179,111,.5); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 .45rem rgba(45,179,111,0); } 100% { box-shadow: 0 0 0 0 rgba(45,179,111,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.online-person { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem .15rem .2rem; border-radius: 999px;
  background: #E8F4EE; color: #1F5A40; font-weight: 600; font-size: .88rem; text-decoration: none; }
[dir=rtl] .online-person { padding: .15rem .2rem .15rem .6rem; }

.stat-strip .cell { padding: .8rem 1rem; border-inline-start: 1px solid var(--line); }
.stat-strip .cell:first-child { border-inline-start: 0; }
.stat-strip .v.small-v { font-size: 1.05rem; padding-block: .3rem; }

.team-table td { padding-block: .65rem; }
.team-table .who-cell { min-width: 13rem; }
.team-table .today-col { min-width: 11rem; width: 15%; }
.team-table .time-cell { min-width: 7.5rem; }
.meter { height: 5px; border-radius: 3px; background: #EFE9E0; margin: .3rem 0 .2rem; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.devices .bi { font-size: 1.05rem; color: var(--ink); margin-inline-end: .35rem; }

/* شريط اليوم: 24 ساعة من اليمين (12 بالليل) للشمال */
.tl { padding: .4rem 1rem 1rem; }
.tl-row { display: grid; grid-template-columns: 7.5rem 1fr 9.5rem; gap: .9rem; align-items: center; padding: .28rem 0; }
.tl-row.off .tl-day { color: var(--muted); }
.tl-row.off .tl-track { background: repeating-linear-gradient(-45deg, #F6F2EC 0 6px, #FBF8F3 6px 12px); }
.tl-day { font-size: .9rem; white-space: nowrap; }
.tl-sum { display: flex; flex-direction: column; font-size: .85rem; line-height: 1.25; }
.tl-track { position: relative; height: 1.15rem; border-radius: 4px; background: #F6F2EC; }
.tl-track.mini { height: .7rem; }
.tl-grid { position: absolute; inset-block: 0; width: 1px; background: rgba(58,71,86,.09); }
.tl-seg { position: absolute; inset-block: 0; border-radius: 3px; background: var(--ink); min-width: 2px; }
.tl-row:not(.idle) .tl-seg:hover { background: var(--crimson); }
.tl-now { position: absolute; inset-block: -3px; width: 2px; background: var(--crimson); border-radius: 1px; }
.tl-ticks { position: relative; height: 1rem; font-size: .7rem; color: var(--muted); }
.tl-ticks span { position: absolute; transform: translateX(50%); white-space: nowrap; }
.tl-ticks span:first-child { transform: none; }
.tl-ticks span:last-child { transform: translateX(100%); }
.tl-ticks.mini { margin-top: .2rem; font-weight: 400; font-size: .65rem; }
.tl-head { padding-bottom: 0; }

.perf { list-style: none; margin: 0; padding: 0; }
.perf li { display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; padding: .6rem 1rem; border-bottom: 1px solid #EFEAE2; }
.perf li:last-child { border-bottom: 0; }
.perf li > span { color: var(--text); }
.perf li > b { text-align: end; }
.perf li > small { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; }

.feed-filter { display: flex; gap: .4rem; margin-inline-start: auto; }
.feed-filter select { width: auto; max-width: 12rem; }
.feed-day { padding: .45rem 1rem; background: #F8F5EF; border-block: 1px solid var(--line); font-weight: 600; font-size: .85rem; color: var(--ink); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed > li { display: grid; grid-template-columns: 4.6rem 4.2rem 1fr; gap: .6rem; align-items: start; padding: .55rem 1rem; border-bottom: 1px solid #EFEAE2; }
.feed > li:last-child { border-bottom: 0; }
.feed-time { font-size: .82rem; color: var(--muted); padding-top: .1rem; }
.act { display: inline-block; text-align: center; font-size: .75rem; font-weight: 600; padding: .12rem .4rem; border-radius: 6px; }
.act-add { background: #E3F2EA; color: var(--ok); }
.act-edit { background: #E6EDF5; color: #2B4C73; }
.act-delete { background: #fde8e8; color: #b42318; }
.act-export { background: #F6ECDA; color: #7a4d00; }
.feed-body .chip { margin-inline-start: .3rem; text-decoration: none; }
.changes { list-style: none; margin: .25rem 0 0; padding: 0; font-size: .82rem; color: var(--muted); }
.changes li { padding: .05rem 0; }
.changes li::before { content: "•"; margin-inline-end: .35rem; color: var(--gold); }
.changes-more summary { font-size: .8rem; color: var(--crimson); cursor: pointer; margin-top: .15rem; }

.footnote { margin: 1rem .2rem 0; font-size: .82rem; color: var(--muted); max-width: 70rem; line-height: 1.7; }

/* طلبات التصدير */
.count-pill { margin-inline-start: .3rem; font-size: .75rem; font-weight: 700; background: var(--logo-crimson); color: #fff; border-radius: 10px; padding: 0 .5rem; }
.ask-card { display: grid; grid-template-columns: 13rem 1fr 15rem; gap: 1rem; align-items: start; padding: .9rem 1rem; border-bottom: 1px solid #EFEAE2; }
.ask-card:last-child { border-bottom: 0; }
.ask-who { display: flex; gap: .55rem; align-items: center; }
.ask-filters { list-style: none; margin: .2rem 0 0; padding: 0; font-size: .85rem; color: var(--muted); }
.ask-reason { margin-top: .4rem; padding: .35rem .6rem; background: var(--soft); border-radius: 8px; font-size: .88rem; }
.ask-decide { display: flex; flex-direction: column; gap: .45rem; }
.xr-state { display: inline-block; font-size: .8rem; font-weight: 600; padding: .12rem .55rem; border-radius: 6px; white-space: nowrap; }
.xr-state.pending { background: #FFF1D6; color: #7a4d00; }
.xr-state.ready { background: #E3F2EA; color: var(--ok); }
.xr-state.expired { background: #F1ECE4; color: var(--muted); }
.xr-state.rejected { background: #fde8e8; color: #b42318; }
.export-ask { max-width: 46rem; }
.ask-what { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1.1rem; }
.ask-what > .bi { font-size: 2rem; color: var(--ok); line-height: 1; }
.ask-state { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; padding: .8rem 1rem; border-radius: 10px; }
.ask-state > .bi { font-size: 1.4rem; }
.ask-state.ok { background: #E8F4EE; color: #1F5A40; }
.ask-state.wait { background: #FFF4E0; color: #6B4500; }

@media (max-width: 991.98px) {
  .ask-card { grid-template-columns: 1fr; gap: .6rem; }
  .page-head .actions .period-bar { width: 100%; }
}
@media (max-width: 575.98px) {
  .tl { padding-inline: .6rem; }
  .tl-row { grid-template-columns: 1fr auto; gap: .2rem .6rem; }
  .tl-row .tl-track, .tl-row .tl-ticks { grid-column: 1 / -1; grid-row: 2; }
  .tl-head .tl-day, .tl-head .tl-sum { display: none; }
  .tl-head .tl-ticks { grid-row: 1; }
  .tl-sum { flex-direction: row; gap: .4rem; align-items: baseline; }
  .tl-row { padding: .4rem 0; border-bottom: 1px solid #F1ECE4; }
  .feed > li { grid-template-columns: auto 1fr; }
  .feed > li .feed-body { grid-column: 1 / -1; }
  .feed-filter { width: 100%; margin-inline-start: 0; }
  .feed-filter select { flex: 1; max-width: none; }
  .period-custom input { width: 8.4rem; }
  .seg-links { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .seg-links a { text-align: center; padding-inline: .3rem; font-size: .82rem; }
}
.stat-strip .cell .v { white-space: nowrap; }
.stat-strip.kpi8 { grid-template-columns: repeat(4, 1fr); }
.stat-strip.kpi8 .cell:nth-child(4n+1) { border-inline-start: 0; }
.stat-strip.kpi8 .cell:nth-child(n+5) { border-top: 1px solid var(--line); }
.team-table .who-cell .small-muted { font-size: .8rem; }
@media (max-width: 575.98px) {
  .stat-strip.kpi8 { grid-template-columns: repeat(2, 1fr); }
  .stat-strip.kpi8 .cell { border-inline-start: 1px solid var(--line); border-top: 0; }
  .stat-strip.kpi8 .cell:nth-child(2n+1) { border-inline-start: 0; }
  .stat-strip.kpi8 .cell:nth-child(n+3) { border-top: 1px solid var(--line); }
  /* جدول الفريق يبقى كروت على الموبايل */
  .team-table thead { display: none; }
  .team-table, .team-table tbody { display: block; }
  .team-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem .8rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
  .team-table td { display: block; border: 0; padding: .3rem 0; min-width: 0 !important; width: auto !important; }
  .team-table td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--muted); margin-bottom: .1rem; }
  .team-table .who-cell, .team-table .today-col { grid-column: 1 / -1; }
  .team-table .today-col { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; }
  .team-table .today-col::before { margin: 0 !important; }
  .team-table .today-col .mt-1 { margin: 0 !important; }
}

/* متابعة المستخدمين — الإضافات */
.team-tools { display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin: -.4rem 0 1rem; }
.team-tools a { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-size: .85rem; text-decoration: none; }
.team-tools a:hover { background: var(--soft); }
.delta { display: inline-block; font-size: .72rem; font-weight: 600; line-height: 1; padding: .12rem .3rem; border-radius: 5px; vertical-align: middle; white-space: nowrap; }
.delta.up { color: #1F6B4A; background: #E3F2EA; }
.delta.down { color: #b42318; background: #fde8e8; }
.delta.flat { color: var(--muted); background: #F1ECE4; }
.stat-strip .v .delta { font-size: .7rem; vertical-align: .35em; }
.stat-strip .v small { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-strip a.cell { color: var(--text); text-decoration: none; }
.stat-strip a.cell:hover { background: var(--soft); }
.count-pill.ok { background: var(--ok); }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-item { display: flex; gap: .65rem; align-items: flex-start; padding: .55rem 1rem; border-bottom: 1px solid #EFEAE2; }
.alert-item > .bi { font-size: 1.1rem; color: var(--muted); margin-top: .1rem; }
.alert-item.high > .bi { color: #b42318; }
.alert-more summary { padding: .5rem 1rem; color: var(--crimson); cursor: pointer; font-size: .88rem; }
.access-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: -.4rem 0 1rem; }
.goal-list { list-style: none; margin: 0; padding: .3rem 0; }
.goal { padding: .55rem 1rem; }
.goal-top { display: flex; gap: .6rem; justify-content: space-between; align-items: baseline; font-size: .92rem; }
.goal-top b { white-space: nowrap; }
.goal-top small { color: var(--muted); font-weight: 400; }
.goal-bar { position: relative; height: 7px; border-radius: 4px; background: #EFE9E0; margin: .35rem 0 .2rem; }
.goal-bar span { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 4px; background: #C9A35F; }
.goal.met .goal-bar span { background: var(--ok); }
.goal.miss .goal-bar span { background: #C9A35F; }
.goal-bar i { position: absolute; inset-block: -3px; width: 2px; background: var(--ink); border-radius: 1px; }
.goal-note { font-size: .78rem; color: var(--muted); }
.goal.met .goal-note { color: var(--ok); }
.cov-table tr.late td:first-child { box-shadow: inset -3px 0 0 #E8A9A9; }
[dir=ltr] .cov-table tr.late td:first-child { box-shadow: inset 3px 0 0 #E8A9A9; }
.login-list li { display: flex; gap: .5rem; align-items: center; font-size: .88rem; padding: .45rem 1rem; }
.neglect-list li { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; }
.feed > li:has(.feed-undo) { grid-template-columns: 4.6rem 4.2rem 1fr auto; }
.feed-undo .btn { white-space: nowrap; }
.act-file { background: #EEF0F3; color: #3A4756; }
.act-restore { background: #E8F4EE; color: #1F5A40; }
.tl-day .holiday { display: block; font-size: .7rem; color: #7a4d00; white-space: normal; }
.goals-table td, .goals-table th { min-width: 7rem; }
.goals-table td:first-child { min-width: 15rem; }
.goals-table .team-col { background: #FBF8F3; }
.goals-table input { max-width: 7rem; }
.dq-group > summary { list-style: none; cursor: pointer; }
.dq-group > summary::-webkit-details-marker { display: none; }
.dq-group > summary h2::before { content: "▸ "; color: var(--muted); }
.dq-group[open] > summary h2::before { content: "▾ "; }
.team-table tr.locked td { opacity: .6; }
.team-table .devices .bi { font-size: .85rem; margin-inline: .15rem 0; }
@media (max-width: 575.98px) {
  .feed > li:has(.feed-undo) { grid-template-columns: auto 1fr auto; }
  .goals-table td:first-child { min-width: 11rem; }
}
.team-table th, .team-table td { padding-inline: .45rem; }
.team-table .who-cell { min-width: 11.5rem; }
.team-table .today-col { min-width: 7.5rem; width: 11%; }
.team-table .time-cell { min-width: 8.5rem; }
