/* Taqrir Core — flat editorial light design */
:root {
  --tq-bg: #ffffff;
  --tq-soft: #f6f8fb;
  --tq-panel: #ffffff;
  --tq-border: #e6eaf0;
  --tq-border-strong: #d3dae4;
  --tq-text: #0f1c2e;
  --tq-muted: #64748b;
  --tq-faint: #94a3b8;
  --tq-primary: #a87f14;
  --tq-primary-hover: #8a680f;
  --tq-primary-soft: #faf3e2;
  --tq-accent: #a87f14;
  --tq-green: #148a4e;
  --tq-red: #d13425;
}

.taqrir-stats, .taqrir-fin, .taqrir-disc, #taqrir-screener, .taqrir-chart-wrap {
  background: transparent;
  color: var(--tq-text);
  border: 0;
  padding: 0;
  margin: 0 0 40px;
  font-family: 'Inter', 'IBM Plex Sans Arabic', -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
}
.taqrir-fin h3, .taqrir-disc h3 {
  margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--tq-text); padding-bottom: 10px; border-bottom: 2px solid var(--tq-text);
}

/* stats: flat row with hairline separators */
.taqrir-stats__head { margin-bottom: 16px; font-size: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.taqrir-ticker { font-weight: 800; color: var(--tq-primary); letter-spacing: .05em; }
.taqrir-name { font-weight: 600; }
.taqrir-exch { color: var(--tq-muted); font-size: 12px; font-weight: 600; letter-spacing: .05em; }
.taqrir-badge { color: var(--tq-green); font-size: 12.5px; font-weight: 600; }
.taqrir-stats__grid { display: flex; flex-wrap: wrap; }
.taqrir-stat { background: transparent; border: 0; border-inline-start: 1px solid var(--tq-border); padding: 2px 22px; }
.taqrir-stat:first-child { border-inline-start: 0; padding-inline-start: 0; }
.taqrir-stat__label { display: block; color: var(--tq-muted); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; }
.taqrir-stat__value { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* tables */
.taqrir-table-scroll { overflow-x: auto; }
.taqrir-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.taqrir-table th, .taqrir-table td { padding: 9px 12px; text-align: end; border-bottom: 1px solid var(--tq-border); white-space: nowrap; font-variant-numeric: tabular-nums; }
.taqrir-table th { color: var(--tq-muted); font-weight: 600; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.taqrir-table td.taqrir-item, .taqrir-table th:first-child { text-align: start; padding-inline-start: 0; }
.taqrir-table td.taqrir-item { font-weight: 500; color: var(--tq-text); position: sticky; inset-inline-start: 0; background: #fff; }
.taqrir-table td.neg { color: var(--tq-red); }
.taqrir-table tbody tr:hover td { background: var(--tq-soft); }
.taqrir-note { color: var(--tq-faint); font-size: 12px; margin: 0 0 8px; }

/* margins history (macrotrends-style stacked panels) */
.taqrir-margins { margin: 0 0 40px; font-family: 'Inter', 'IBM Plex Sans Arabic', -apple-system, "Segoe UI", Tahoma, Arial, sans-serif; }
.taqrir-margins h3 {
  margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--tq-text); padding-bottom: 10px; border-bottom: 2px solid var(--tq-text);
}
.taqrir-margins__zoom { display: inline-flex; margin-bottom: 8px; border-bottom: 1px solid var(--tq-border); }
.taqrir-margins__zoom button {
  background: transparent; color: var(--tq-muted); border: 0; border-bottom: 2px solid transparent;
  padding: 6px 14px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; margin-bottom: -1px;
}
.taqrir-margins__zoom button:hover { color: var(--tq-text); }
.taqrir-margins__zoom button.active { color: var(--tq-primary); border-bottom-color: var(--tq-primary); }
.taqrir-margins__panel { border-bottom: 1px solid var(--tq-border); padding: 6px 0; }
.taqrir-margins__panel:last-child { border-bottom: 0; }
.taqrir-margins__label { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--tq-muted); margin: 6px 0 0; }

/* financials controls (period switch + chart type) */
.taqrir-fin-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.taqrir-fin-periods { display: inline-flex; border-bottom: 1px solid var(--tq-border); }
.taqrir-fin-periods button {
  background: transparent; color: var(--tq-muted); border: 0; border-bottom: 2px solid transparent;
  padding: 6px 14px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; margin-bottom: -1px;
}
.taqrir-fin-periods button:hover { color: var(--tq-text); }
.taqrir-fin-periods button.active { color: var(--tq-primary); border-bottom-color: var(--tq-primary); }
.taqrir-fin-type {
  background: #fff; color: var(--tq-text); border: 1px solid var(--tq-border-strong); font-family: inherit;
  border-radius: 4px; padding: 6px 10px; font-size: 13px; outline: none;
}
.taqrir-fin-type:focus { border-color: var(--tq-primary); }

/* click-to-chart rows */
.taqrir-fin tbody tr { cursor: pointer; }
.taqrir-fin tbody tr.sel td, .taqrir-fin tbody tr.sel td.taqrir-item { background: var(--tq-primary-soft); }
.taqrir-fin-chart { margin-top: 14px; }

/* chart */
.taqrir-chart { min-height: 320px; }
.taqrir-chart-ranges { display: inline-flex; margin-bottom: 10px; border-bottom: 1px solid var(--tq-border); }
.taqrir-chart-ranges button {
  background: transparent; color: var(--tq-muted); border: 0; border-bottom: 2px solid transparent;
  padding: 6px 14px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; margin-bottom: -1px;
}
.taqrir-chart-ranges button:hover { color: var(--tq-text); }
.taqrir-chart-ranges button.active { color: var(--tq-primary); border-bottom-color: var(--tq-primary); }

/* disclosures */
.taqrir-disc ul { list-style: none; margin: 0; padding: 0; }
.taqrir-disc li { padding: 10px 0; border-bottom: 1px solid var(--tq-border); font-size: 14px; }
.taqrir-disc__date { color: var(--tq-faint); font-size: 12.5px; margin-inline-end: 12px; font-variant-numeric: tabular-nums; }
.taqrir-disc a { color: var(--tq-text); text-decoration: none; font-weight: 500; }
.taqrir-disc a:hover { color: var(--tq-primary); }

/* screener */
.taqrir-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.taqrir-filters input, .taqrir-filters select {
  background: #fff; color: var(--tq-text); border: 1px solid var(--tq-border-strong); font-family: inherit;
  border-radius: 4px; padding: 7px 11px; font-size: 14px; outline: none;
}
.taqrir-filters input:focus, .taqrir-filters select:focus { border-color: var(--tq-primary); }
.taqrir-filters input[type=search] { flex: 1; min-width: 180px; }
#taqrir-screener table { width: 100%; border-collapse: collapse; font-size: 14px; }
#taqrir-screener th { color: var(--tq-muted); cursor: pointer; user-select: none; text-align: end; padding: 8px 10px; border-bottom: 2px solid var(--tq-text); white-space: nowrap; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
#taqrir-screener th:hover { color: var(--tq-primary); }
#taqrir-screener th:first-child, #taqrir-screener td:first-child { text-align: start; padding-inline-start: 0; }
#taqrir-screener td { padding: 9px 10px; border-bottom: 1px solid var(--tq-border); text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
#taqrir-screener tbody tr:hover td { background: var(--tq-soft); cursor: pointer; }
#taqrir-screener .tick { color: var(--tq-primary); font-weight: 700; letter-spacing: .03em; }
.taqrir-loading, .taqrir-empty { color: var(--tq-muted); }
#taqrir-screener td.pos { color: var(--tq-green); font-weight: 600; }
#taqrir-screener td.neg { color: var(--tq-red); font-weight: 600; }

/* watch button */
.taqrir-watch {
  display: inline-block; background: transparent; color: var(--tq-primary); font-family: inherit;
  border: 1px solid var(--tq-primary); border-radius: 4px; padding: 6px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; margin: 4px 0;
}
.taqrir-watch:hover { background: var(--tq-primary-soft); color: var(--tq-primary); }

/* ---------- mobile ---------- */
.taqrir-table-scroll { -webkit-overflow-scrolling: touch; }
@media (max-width: 760px) {
  .taqrir-stats, .taqrir-fin, .taqrir-disc, #taqrir-screener, .taqrir-chart-wrap { margin-bottom: 32px; }

  /* stats become a 2-col grid instead of a hairline row */
  .taqrir-stats__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
  .taqrir-stat { border-inline-start: 0; padding: 0; }
  .taqrir-stat__value { font-size: 17px; }

  /* filters: search full width, selects side by side */
  .taqrir-filters input[type=search] { flex-basis: 100%; height: 42px; font-size: 16px; }
  .taqrir-filters select { flex: 1; height: 42px; font-size: 15px; }

  /* tables: allow swipe, slightly tighter */
  .taqrir-table th, .taqrir-table td, #taqrir-screener th, #taqrir-screener td { padding: 8px 8px; font-size: 13px; }
  .taqrir-table td.taqrir-item { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #taqrir-screener table { min-width: 720px; }
  #taqrir-screener { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* chart */
  .taqrir-chart { min-height: 240px; }
  .taqrir-chart-ranges { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .taqrir-chart-ranges button { padding: 8px 12px; }

  /* watch button easy to tap */
  .taqrir-watch { padding: 10px 20px; }

  .taqrir-margins__zoom { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .taqrir-margins__zoom button { padding: 9px 12px; white-space: nowrap; }

  /* financials controls stack */
  .taqrir-fin-controls { align-items: stretch; }
  .taqrir-fin-periods { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .taqrir-fin-periods button { padding: 9px 12px; white-space: nowrap; }
  .taqrir-fin-type { height: 42px; font-size: 15px; }
}
