/* المستثمر المصري — design system (Arabic-first, RTL) */
:root {
  --ink: #15201d;
  --ink-2: #44524d;
  --muted: #6d7a75;
  --bg: #f4f6f5;
  --card: #ffffff;
  --line: #e1e7e4;
  --green: #0c6b58;
  --green-dark: #084c3f;
  --gold: #c99a3c;
  --gold-soft: #f6ecd9;
  --up: #0e8a4f;
  --down: #c0392b;
  --flat: #6d7a75;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 32, 29, .05), 0 8px 24px rgba(21, 32, 29, .06);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; padding: 24px 0 48px; }
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* header */
.site-header { background: var(--green-dark); color: #fff; box-shadow: var(--shadow); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), #e3b65c); color: var(--green-dark);
  font-weight: 700; font-size: 1.3rem;
}
.brand-text b { color: var(--gold); }
.brand.small .brand-mark { width: 28px; height: 28px; font-size: 1rem; border-radius: 8px; }
.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-link { color: #e8efec; padding: 8px 12px; border-radius: 8px; }
.nav-link:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.inline-form { display: inline; }

/* buttons & forms */
.btn {
  display: inline-block; border: 1px solid transparent; border-radius: 10px; padding: 9px 18px;
  font: inherit; font-weight: 600; cursor: pointer; text-align: center;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn-primary { background: var(--gold); color: var(--green-dark); }
.btn-secondary { background: var(--green); color: #fff; }
.btn-ghost { background: transparent; color: #e8efec; border-color: rgba(255,255,255,.3); }
.btn-outline { background: transparent; color: var(--green); border-color: var(--green); }
.btn-danger { background: #fbeae7; color: var(--down); border-color: #efc4bd; }
.btn-sm { padding: 5px 12px; font-size: .85rem; border-radius: 8px; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 16px; }
.form-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card h2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* stat tiles */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { font-size: .82rem; color: var(--muted); }
.stat .value { font-size: 1.25rem; font-weight: 700; margin-top: 2px; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--flat); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; background: #fafbfa; position: sticky; top: 0; }
tr:hover td { background: #f8faf9; }
td.wrap, th.wrap { white-space: normal; }

/* badges & flash */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge-ok { background: #e3f3ea; color: var(--up); }
.badge-warn { background: var(--gold-soft); color: #8a6414; }
.badge-err { background: #fbeae7; color: var(--down); }
.badge-muted { background: #eef1f0; color: var(--muted); }
.flash { padding: 12px 16px; border-radius: 12px; margin: 16px 0 0; font-weight: 500; }
.flash-ok { background: #e3f3ea; color: var(--up); }
.flash-warn { background: var(--gold-soft); color: #8a6414; }
.flash-err { background: #fbeae7; color: var(--down); }
.errors { background: #fbeae7; color: var(--down); border-radius: 12px; padding: 10px 16px; margin-bottom: 14px; }
.errors ul { margin: 0; padding-inline-start: 18px; }

/* hero / home */
.hero {
  background: linear-gradient(160deg, var(--green-dark), var(--green) 70%, #11806a);
  color: #fff; border-radius: 18px; padding: 36px 32px; margin-bottom: 24px;
}
.hero h1 { font-size: 2rem; margin-bottom: 8px; }
.hero p { color: #d7e5e0; max-width: 60ch; margin: 0 0 18px; }
.index-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.index-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.index-card .code { color: var(--muted); font-size: .8rem; letter-spacing: .5px; }
.index-card .name { font-weight: 700; font-size: 1.05rem; }
.index-card .val { font-size: 1.8rem; font-weight: 700; margin: 6px 0 2px; }
.index-card .chg { font-weight: 600; }
.index-card .meta { font-size: .78rem; color: var(--muted); margin-top: 8px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.spark { width: 100%; height: 44px; margin-top: 10px; }

/* allocation donut (conic-gradient set inline per page) */
.donut { width: 160px; height: 160px; border-radius: 50%; margin-inline: auto; position: relative; }
.donut::after { content: ''; position: absolute; inset: 22%; background: var(--card); border-radius: 50%; }
.legend { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: .88rem; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 8px; }

/* subnav for app/admin */
.subnav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.subnav a { padding: 7px 14px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.subnav a:hover { background: var(--bg); text-decoration: none; }
.subnav a.active { background: var(--green); color: #fff; }

/* misc */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 140px; }
details.form-details { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; background: #fcfdfc; }
details.form-details summary { cursor: pointer; font-weight: 600; color: var(--green); }
details.grant-box, details.move-box { position: relative; display: inline-block; margin-top: 4px; }
details.grant-box summary, details.move-box summary { cursor: pointer; list-style: none; }
details.grant-box summary::-webkit-details-marker, details.move-box summary::-webkit-details-marker { display: none; }
details.grant-box[open] .grant-form, details.move-box[open] .grant-form { position: absolute; inset-inline-end: 0; z-index: 10; min-width: 260px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); text-align: start; }
details.grant-box .grant-form .field, details.move-box .grant-form .field { margin-bottom: 8px; }
ul.fee-breakdown { list-style: none; margin: 8px 0 0; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; font-size: .85rem; background: #fcfdfc; }
ul.fee-breakdown li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
ul.fee-breakdown li.fee-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; font-weight: 600; }
.product-detail { margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: .85rem; background: #fcfdfc; max-height: 280px; overflow: auto; }
.check-inline { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 400; font-size: .82rem; color: var(--muted); }
.check-inline input { width: auto; }
.product-detail .pd-title { font-weight: 700; margin-bottom: 4px; }
.product-detail .pd-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.product-detail .pd-label { color: var(--muted); }
.product-detail .pd-status { margin: 2px 0 6px; padding: 4px 8px; border-radius: 8px; font-weight: 600; }
.product-detail .pd-status-ok { background: #e8f5ec; color: #1b6e3c; }
.product-detail .pd-status-no { background: #fdecec; color: #a12622; }
.product-detail .pd-details { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .8rem; line-height: 1.6; }
/* دليل الشهادات والودائع: one card per ranked product, every detail on it, at most 3 a row */
.bp-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; } .bp-jump a { background: #fff; }
.bp-section { scroll-margin-top: 90px; }
.bp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .bp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .bp-grid { grid-template-columns: minmax(0, 1fr); } }
.bp-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; font-size: .85rem;
  display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bp-head { display: flex; align-items: center; gap: 10px; }
.bp-head .bp-logo { width: 88px; flex: 0 0 88px; height: 50px; }
.bp-head .bp-logo img { padding: 4px 6px; }
.bp-titles { flex: 1; min-width: 0; }
.bp-bank { color: var(--muted); font-size: .78rem; font-weight: 600; }
.bp-name { font-weight: 800; color: var(--ink); line-height: 1.5; }
.bp-rank { align-self: flex-start; color: var(--muted); font-weight: 700; font-size: .78rem; }
.bp-rate b { font-size: 1.6rem; font-weight: 800; color: var(--green); }
.bp-card .pd-status { margin: 0; padding: 4px 8px; border-radius: 8px; font-weight: 600; font-size: .8rem; }
.bp-card .pd-status-ok { background: #e8f5ec; color: #1b6e3c; }
.bp-card .pd-status-no { background: #fdecec; color: #a12622; }
.bp-rows .pd-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.bp-rows .pd-row:last-child { border-bottom: 0; }
.bp-rows .pd-label { color: var(--muted); }
.bp-card .pd-details { padding-top: 6px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .8rem; line-height: 1.6; }
.bp-sub { font-weight: 700; font-size: .8rem; }
.bp-steps, .bp-history { display: flex; flex-wrap: wrap; gap: 6px; }
.bp-steps span, .bp-history span { background: #f3f6f4; border-radius: 8px; padding: 2px 8px; font-size: .78rem; }
.bp-history span span { background: none; padding: 0; }
#tb-result { max-height: none; font-size: .95rem; }
.hint.warn { color: #a12622; font-weight: 600; }
a.fund-card { display: block; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.fund-card:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .09); transform: translateY(-2px); }
a.fund-card .name { margin-top: 2px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f3f8f4; }
.year-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 4px; }
.year-boxes .year-box label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 2px; }
.year-boxes .year-box input { width: 100%; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.suggest-list { position: relative; }
.suggest-items { position: absolute; top: 100%; right: 0; left: 0; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.suggest-items button { display: block; width: 100%; text-align: right; background: none; border: 0; padding: 8px 12px; font: inherit; cursor: pointer; }
.suggest-items button:hover { background: var(--bg); }

/* footer */
.site-footer { background: var(--green-dark); color: #cfe0db; margin-top: 40px; padding: 32px 0 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; padding-bottom: 20px; }
.site-footer h4 { color: #fff; margin-bottom: 8px; }
.site-footer a { display: block; color: #cfe0db; padding: 3px 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding: 14px 0; font-size: .82rem; }
.site-footer .muted { color: #9fb8b1; }

@media (max-width: 640px) {
  .hero { padding: 26px 20px; }
  .hero h1 { font-size: 1.5rem; }
  h1 { font-size: 1.4rem; }
  th, td { padding: 7px 8px; }
}

/* ------- interactive fund chart ------- */
.chart-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.chart-periods { display: flex; gap: 4px; flex-wrap: wrap; }
.chart-periods button { border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 3px 12px; font-size: .78rem; cursor: pointer; font-family: inherit; }
.chart-periods button.active { background: var(--green); border-color: var(--green); color: #fff; }
.chart-box { position: relative; }
.chart-tip { position: absolute; background: rgba(20, 32, 27, .92); color: #fff; border-radius: 8px;
  padding: 6px 10px; font-size: .78rem; line-height: 1.5; pointer-events: none; z-index: 5; direction: rtl; }
.chart-tip .up { color: #7fe0ae; } .chart-tip .down { color: #ff9f8f; }
.chart-est-band { fill: rgba(201, 162, 39, .14); }
.chart-tip .chart-est-tag { display: inline-block; margin-inline-start: 4px; padding: 0 6px; border-radius: 6px;
  background: #c9a227; color: #14201b; font-size: 11px; font-weight: 700; }
.chart-est-note { display: inline-block; margin-top: 4px; padding-inline-start: 8px; border-inline-start: 3px solid #c9a227;
  font-size: 12.5px; color: var(--muted, #6d7a75); }

/* ------- fund directory cards (reference format, site theme) ------- */
a.fund-card2 { display: flex; flex-direction: column; gap: 10px; background: var(--card); color: var(--ink);
  border-radius: 16px; padding: 16px; border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s; }
a.fund-card2:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .1); color: var(--ink); }
.fc-head { display: flex; align-items: flex-start; gap: 12px; }
.fc-logo { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 12px; background: #fff;
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fc-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.fc-logo span { color: var(--green); font-weight: 800; font-size: 1.2rem; }
.fc-name { font-weight: 800; font-size: .95rem; line-height: 1.6; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fc-price-label { color: var(--muted); font-size: .78rem; text-align: right; }
.fc-price-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fc-price { font-size: 1.5rem; font-weight: 800; color: var(--ink); letter-spacing: .5px; }
.fc-chg { font-size: .8rem; font-weight: 700; }
.fc-chg.up { color: var(--up); } .fc-chg.down { color: var(--down); }
a.fund-card2 .fc-date { display: flex; align-items: center; gap: 6px; justify-content: flex-start;
  color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); padding-top: 10px; }
.fc-btn { background: var(--green); color: #fff; text-align: center; border-radius: 10px;
  padding: 10px 12px; font-weight: 700; font-size: .9rem; }
a.fund-card2:hover .fc-btn { background: var(--green-dark); }
.fund-logo-head { width: 52px; height: 52px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden; vertical-align: middle; margin-inline-start: 10px; }
.fund-logo-head img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

/* ------- stock analysis page ------- */
.stk-results { position: absolute; top: 100%; right: 0; left: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.12); z-index: 30; max-height: 360px; overflow: auto; }
.stk-res { padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex;
  justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.stk-res:hover { background: var(--bg); }
.stk-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.stk-tabs button { border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 7px 16px; font-size: .85rem; cursor: pointer; font-family: inherit; font-weight: 600; }
.stk-tabs button.active { background: var(--green); border-color: var(--green); color: #fff; }
.stk-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---- Market Analysis (تحليل السوق) ---- */
.stk-tabs a.mk-tab { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px;
  padding: 7px 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.stk-tabs a.mk-tab.active { background: var(--green); color: #fff; border-color: var(--green); }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.rec-badge { display: inline-block; padding: 6px 16px; border-radius: 999px; font-weight: 800; font-size: 1.05rem; }
.rec-buy { background: #e3f3ea; color: var(--up); } .rec-dot.rec-buy { background: var(--up); }
.rec-sell { background: #fbeae7; color: var(--down); } .rec-dot.rec-sell { background: var(--down); }
.rec-hold { background: var(--gold-soft); color: #8a6414; } .rec-dot.rec-hold { background: #c9962e; }
.rec-watch { background: #eef1f4; color: #4a5866; } .rec-dot.rec-watch { background: #8a97a5; }
.mk-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.mk-price { text-align: left; }
.mk-val { font-size: 1.9rem; font-weight: 800; }
.mk-rec-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mk-dir { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.mk-list { padding-inline-start: 20px; line-height: 1.9; margin: 0; }
.mk-now td { background: var(--gold-soft); }
.mk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-chips span { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: .9rem; }
.mk-chart { width: 100%; height: auto; color: var(--ink-2); margin-top: 14px; }
.mk-stats { margin: 12px 0; } .mk-stats b { font-size: 1.3rem; }
.mk-years { display: grid; gap: 6px; }
.mk-year { display: grid; grid-template-columns: 110px 1fr 80px; align-items: center; gap: 10px; }
.mk-bar-wrap { background: #f1f3f2; border-radius: 6px; height: 12px; overflow: hidden; }
.mk-bar { display: block; height: 100%; border-radius: 6px; }
.mk-bar.pos { background: var(--up); } .mk-bar.neg { background: var(--down); }
.mk-v { text-align: left; font-weight: 700; }
.mk-plain { border-inline-start: 4px solid var(--gold); background: #fffdf7; }
.mk-plain-h { margin: 14px 0 4px; color: var(--green); }
/* grouped main tabs */
.nav-group { position: relative; outline: none; }
.nav-group-btn { background: none; border: 0; font: inherit; cursor: pointer; }
.nav-group-btn:hover { background: rgba(255,255,255,.1); }
.nav-menu { display: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 190px; z-index: 50;
  background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; }
.nav-group:hover .nav-menu, .nav-group:focus-within .nav-menu { display: block; }
.nav-menu-item { display: block; padding: 9px 12px; border-radius: 8px; color: #1d2b26; white-space: nowrap; }
.nav-menu-item:hover { background: #eef5f1; text-decoration: none; }
/* fund comparison */
.fc-list { max-height: 260px; overflow-y: auto; border: 1px solid #e3ebe7; border-radius: 10px; padding: 6px; margin-top: 8px; }
.fc-item { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.fc-item:hover { background: #f3f8f5; }
.fc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fc-chip { border: 0; background: #e3f1ea; color: #1d4d3a; border-radius: 999px; padding: 4px 12px; font: inherit; cursor: pointer; }
.fc-best { font-weight: 700; background: #e8f6ee; }
.fc-item input[type=checkbox] { width: auto; flex: none; margin: 0; }
.fc-item span:first-of-type { flex: 1; text-align: start; }
/* index constituents */
.ic-table td, .ic-table th { white-space: nowrap; }
.ic-w { min-width: 90px; }
.ic-bar { height: 5px; background: #eef3f0; border-radius: 3px; margin-top: 4px; overflow: hidden; }
.ic-bar i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.ic-range { position: relative; height: 5px; background: linear-gradient(90deg, #f3c9c4, #eef3f0, #bfe6cf); border-radius: 3px; margin: 2px 0 4px; min-width: 90px; }
.ic-range i { position: absolute; top: -3px; width: 3px; height: 11px; background: var(--ink, #1d2b26); border-radius: 2px; transform: translateX(-50%); }
.ic-sector { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin-bottom: 10px; }
.ic-sector .ic-bar { grid-column: 1 / -1; margin-top: 0; }
/* admin: research suggestions for locked fund fields */
.fe-pending { border: 1px solid #bfe6cf; }
.fe-pend-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.fe-pend-text { white-space: pre-wrap; }
.fe-pend-new { background: #eef8f2; }
@media (max-width: 700px) { .fe-pend-row { grid-template-columns: 1fr; } }

/* حقوق الاكتتاب: one card per rights issue */
.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.rt-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 14px; }
.rt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rt-name { font-size: 1.15rem; font-weight: 700; }
.rt-hold { margin: 0; padding: 8px 12px; border-radius: 8px; background: rgba(214, 140, 0, .1); font-size: .9rem; }
.rt-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rt-steps li { border-top: 3px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.rt-steps li.done { border-color: var(--up); }
.rt-steps li.now { border-color: var(--brand, var(--up)); }
.rt-steps li .label { color: var(--muted, #777); font-size: .8rem; }
.rt-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; }
.rt-facts div { display: flex; flex-direction: column; gap: 2px; }
.rt-facts dt { color: var(--muted, #777); font-size: .8rem; }
.rt-facts dd { margin: 0; font-weight: 600; }
.ipo-note { margin: 0; line-height: 1.8; font-size: .95rem; }
.ipo-news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ipo-news li { display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.ipo-news li:last-child { border-bottom: 0; padding-bottom: 0; }
.brief details { border-top: 1px solid var(--line); padding: 10px 0; }
.brief details:first-of-type { border-top: 0; }
.brief summary { cursor: pointer; font-weight: 600; }
.brief p, .brief ul { margin: 8px 0 0; line-height: 1.9; }
.brief .formula { background: var(--bg, #f5f6f5); padding: 6px 10px; border-radius: 6px; font-size: .9rem; }
.fair-note { background: rgba(31, 107, 79, .06); border-radius: 8px; padding: 10px 12px; }
.fair-note p { margin: 6px 0 0; line-height: 1.8; }
/* فرص التداول */
.op-market.bear { border-color: var(--down); background: rgba(192, 57, 43, .05); }
.op-market p { margin: 8px 0 0; line-height: 1.8; }
.op-card.watch { opacity: .92; border-style: dashed; }
.op-watch { background: rgba(192, 57, 43, .08); color: var(--down); border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: .9rem; }
.op-watch-why { border-inline-start: 4px solid var(--down); background: rgba(192, 57, 43, .05); line-height: 1.8; margin-bottom: 12px; }
.op-resp { border-color: var(--line); background: rgba(214, 140, 0, .07); }
.op-resp p { margin: 6px 0 0; line-height: 1.8; }
.op-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.op-price { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.op-kind { text-align: end; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.op-budget { background: rgba(31, 107, 79, .07); border: 1px solid rgba(31, 107, 79, .25); border-radius: 10px; padding: 10px 12px; }
.op-budget-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.op-ladder { display: flex; flex-direction: column; gap: 6px; }
.op-bar { position: relative; display: flex; height: 8px; border-radius: 4px; overflow: hidden; direction: ltr; }
.op-bar .op-loss { background: var(--down); opacity: .55; }
.op-bar .op-win { background: var(--up); opacity: .65; }
.op-bar i { position: absolute; top: -3px; width: 3px; height: 14px; background: var(--text, #222); transform: translateX(-50%); }
.op-marks { display: flex; justify-content: space-between; font-size: .85rem; direction: ltr; }
.op-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.op-tiles > div { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 2px; text-align: center; }
.op-tiles .label { font-size: .75rem; color: var(--muted); }
/* ملخص السوق (Home) */
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.mk-stat { margin-bottom: 0; display: flex; flex-direction: column; gap: 6px; }
.mk-stat .label { color: var(--muted); font-size: .85rem; }
.mk-stat .value { font-size: 1.5rem; font-weight: 700; }
.mk-stat .mk-sector { font-size: 1.1rem; }
.mk-row { display: flex; justify-content: space-between; gap: 8px; font-size: .92rem; }
.mk-breadth { display: flex; height: 8px; border-radius: 4px; overflow: hidden; }
.mk-breadth .up-bg { background: var(--up); } .mk-breadth .down-bg { background: var(--down); } .mk-breadth .flat-bg { background: var(--line); }

/* تقارير الأداء */
.fp-pickers { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 4px 0 14px; }
.fp-pick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fp-pick select { max-width: 100%; min-width: 0; }
.fp-title { margin: 6px 0 4px; font-size: 1.15rem; }
.fp-table th, .fp-table td { white-space: nowrap; text-align: center; }
.fp-table td.fp-name { white-space: normal; text-align: right; min-width: 200px; }
.fp-table td.fp-na { color: var(--muted, #888); font-size: .78rem; }
.fp-table .fp-dist, .fc-dist { color: var(--brand, var(--up)); cursor: help; }

/* فرص التداول: compact result cards */
.op-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .op-results { grid-template-columns: 1fr; } }
.op-res { padding: 12px 14px; border-inline-start: 4px solid var(--line); display: grid; gap: 6px; }
.op-res.win { border-inline-start-color: var(--up); }
.op-res.loss { border-inline-start-color: var(--down); }
.op-res-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.op-res-head .small { display: block; }
.op-res-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.op-res-pct { font-size: 1.15rem; }
/* فرص التداول: weekly / monthly results */
.pr-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pr-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.pr-switch a { padding: 6px 16px; color: var(--ink-2); text-decoration: none; }
.pr-switch a.active { background: var(--green); color: #fff; }
.pr-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pr-nav a { text-decoration: none; }
.pr-table td, .pr-table th { text-align: center; }
.pr-table td:first-child, .pr-table th:first-child { text-align: start; }

/* Stock logos (public/img/stocks, from the local system) */
.stk-logo { width: 24px; height: 24px; object-fit: contain; background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 1px; vertical-align: middle; margin-inline-end: 6px; flex: none; }
.stk-named { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stk-named > .stk-logo { width: 36px; height: 36px; margin: 0; border-radius: 8px; }
.stk-head { display: flex; align-items: center; gap: 10px; }
.stk-head > .stk-logo { width: 44px; height: 44px; margin: 0; border-radius: 10px; }
.ba-banks { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 10px; }
.ba-bank { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; text-align: center; font-size: .8rem; font-weight: 600; }
.ba-bank:hover, .ba-bank.active { border-color: var(--green); box-shadow: 0 0 0 2px #e8f5ec; }
.ba-bank .bp-logo { width: 100px; height: 50px; }
.ba-tiers { width: 100%; border-collapse: collapse; font-size: .8rem; }
.ba-tiers th, .ba-tiers td { padding: 3px 4px; border-bottom: 1px dashed var(--line); text-align: start; }
.ba-tiers th { color: var(--muted); font-weight: 600; }
.bp-card details summary { cursor: pointer; font-weight: 700; font-size: .8rem; }
.bp-card details .pd-details { margin-top: 6px; white-space: pre-line; }
.ba-calc-result { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f6faf7; }
.ba-calc-result .pd-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.ba-calc-result .pd-title { font-weight: 800; margin-bottom: 4px; }
#ba-calc { scroll-margin-top: 90px; }
.bp-verified { font-size: .78rem; color: #1b6e3c; margin-top: 4px; }
.pd-status.bp-outdated, .bp-card .pd-status.bp-outdated { background: #fff4e0; color: #8a5300; }
/* wide tables (تقارير الأداء, مقارنة الصناديق) have too many columns for the 1200px page: they take the whole screen
   width (a 24px margin each side), centred, so a row reads without scrolling sideways on a desktop (operator 2026-11-01) */
.page-wide { --wide-w: min(1680px, calc(100vw - 48px)); width: var(--wide-w); margin-inline-start: calc((100% - var(--wide-w)) / 2); }
.fp-table th, .fp-table td { padding: 8px 7px; }
.fp-table td .small { white-space: normal; max-width: 120px; margin-inline: auto; line-height: 1.35; }
.fp-table td.fp-name { max-width: 340px; }
.fp-table td.fp-name .small { max-width: none; margin-inline: 0; }
@media (max-width: 760px) { .page-wide { --wide-w: 100%; } }

/* members' pages (operator 2026-11-03): a faint per-user watermark over the page - who is looking and when -
   so a leaked screenshot names its account; printing shows a notice instead of the page */
.wm {
  position: fixed; inset: -20vh -20vw; z-index: 9990; pointer-events: none; user-select: none; overflow: hidden;
  display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; gap: 90px 70px;
  transform: rotate(-24deg); color: rgba(128, 128, 128, .13); font: 600 13px/1.4 system-ui, sans-serif;
  white-space: nowrap; direction: ltr;
}
.wm span { display: block; }
.print-block { display: none; }
@media print {
  body.protected > *:not(.print-block) { display: none !important; }
  body.protected .print-block { display: block; padding: 40px; font-size: 20px; text-align: center; }
}
