/* EVO dashboard – colours of evo.ma (dark navy, orange) */
:root {
  --bg: #030712;
  --card: #0d1424;
  --card2: #111a2e;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --soft: rgba(255, 255, 255, 0.42);
  --orange: #f7931e;
  --orange2: #ff6b35;
  --navy: #1e3a6e;
  --green: #3ecf8e;
  --red: #ff5a5f;
  --yellow: #f5c542;
  --blue: #5aa9ff;
  --radius: 14px;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Noto Sans Arabic", Tahoma, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
[dir="rtl"] body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Kufi Arabic", system-ui, sans-serif; }
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.soft { color: var(--soft); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(3, 7, 18, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px; height: 58px;
  display: flex; align-items: center; gap: 14px;
}
.brand { font-weight: 800; letter-spacing: 0.02em; font-size: 18px; white-space: nowrap; }
.brand span { color: var(--orange); }
.tenant-pill {
  border: 1px solid var(--line2); border-radius: 999px; padding: 4px 12px;
  font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw;
}
select.tenant-pill { background: var(--card); cursor: pointer; color: var(--text); width: auto; padding: 4px 10px; }
.spacer { flex: 1; }
.iconbtn {
  background: transparent; border: 1px solid var(--line2); border-radius: 10px;
  padding: 6px 10px; cursor: pointer; font-size: 13px; color: var(--muted); white-space: nowrap;
}
.iconbtn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }

nav.tabs {
  max-width: 1200px; margin: 0 auto; padding: 0 12px; display: flex; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a {
  padding: 10px 12px; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
nav.tabs a:hover { color: #fff; text-decoration: none; }
nav.tabs a.active { color: #fff; border-bottom-color: var(--orange); }

main { max-width: 1200px; margin: 0 auto; padding: 22px 16px 60px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.page-head .spacer { min-width: 10px; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 30px; font-weight: 800; margin-top: 2px; }
.kpi .hint { color: var(--soft); font-size: 12px; }
a.kpi { color: inherit; display: block; transition: border-color .15s; }
a.kpi:hover { text-decoration: none; border-color: rgba(247, 147, 30, 0.6); }
.two { grid-template-columns: 1fr; }
@media (min-width: 900px) { .two { grid-template-columns: 1.4fr 1fr; } }
.section-title { margin: 26px 0 12px; font-size: 15px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
[dir="rtl"] .section-title { letter-spacing: 0; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; background: var(--card2); border: 1px solid var(--line2); border-radius: 10px;
  padding: 9px 11px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--orange); }
textarea { min-height: 70px; resize: vertical; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row > * { flex: 1 1 140px; }
.row > .fixed { flex: 0 0 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 12px; padding: 9px 16px; cursor: pointer;
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--orange2); }
.btn-ghost { background: transparent; border-color: var(--line2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { border-color: rgba(255,255,255,.35); }
.btn-green { background: rgba(62, 207, 142, .15); border-color: rgba(62, 207, 142, .5); color: var(--green); }
.btn-red { background: rgba(255, 90, 95, .12); border-color: rgba(255, 90, 95, .45); color: var(--red); }
.btn-small { padding: 5px 10px; font-size: 13px; border-radius: 9px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid; white-space: nowrap;
}
.st-pending_validation { color: var(--yellow); border-color: rgba(245,197,66,.45); background: rgba(245,197,66,.08); }
.st-validated { color: var(--green); border-color: rgba(62,207,142,.45); background: rgba(62,207,142,.08); }
.st-to_call_back { color: var(--orange); border-color: rgba(247,147,30,.5); background: rgba(247,147,30,.08); }
.st-no_answer { color: var(--red); border-color: rgba(255,90,95,.45); background: rgba(255,90,95,.08); }
.st-cancelled { color: var(--soft); border-color: var(--line2); }
.tp { color: var(--blue); border-color: rgba(90,169,255,.4); }
.ok { color: var(--green); border-color: rgba(62,207,142,.45); }
.off { color: var(--soft); border-color: var(--line2); }

/* ---------- tables / lists ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--line2); background: transparent; border-radius: 999px; padding: 5px 12px;
  font-size: 13px; cursor: pointer; color: var(--muted);
}
.chip.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: start; font-size: 12px; color: var(--soft); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: rgba(255,255,255,.03); }
.table td.end, .table th.end { text-align: end; }
.list-empty { padding: 30px; text-align: center; color: var(--soft); }
.more { display: flex; justify-content: center; margin-top: 14px; }

/* phones: tables become cards */
@media (max-width: 720px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 8px 12px; background: var(--card); }
  .table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; }
  .table td::before { content: attr(data-label); color: var(--soft); font-size: 12px; }
  .table td.end { text-align: start; }
  .card.flush { padding: 10px; background: transparent; border: 0; }
  .brand small { display: none; }
}

/* ---------- detail ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv .k { color: var(--soft); font-size: 13px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 10px; }
.total { font-size: 22px; font-weight: 800; }

/* ---------- login ---------- */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 380px; }
.login .brand { font-size: 26px; margin-bottom: 4px; }
.glow { position: fixed; inset: auto auto -150px -150px; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(rgba(30,58,110,.35), transparent 70%); pointer-events: none; z-index: -1; }
.glow2 { position: fixed; top: -200px; right: -200px; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(rgba(247,147,30,.07), transparent 70%); pointer-events: none; z-index: -1; }

/* ---------- messages ---------- */
.alert { border-radius: 12px; padding: 10px 14px; margin: 10px 0; font-size: 14px; }
.alert-error { background: rgba(255,90,95,.1); border: 1px solid rgba(255,90,95,.4); color: #ffb3b5; }
.alert-ok { background: rgba(62,207,142,.1); border: 1px solid rgba(62,207,142,.4); color: #b4f2d6; }
.alert-info { background: rgba(247,147,30,.08); border: 1px solid rgba(247,147,30,.4); }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 18px; letter-spacing: .05em; background: var(--card2);
  border: 1px dashed var(--orange); border-radius: 10px; padding: 10px; margin: 8px 0; direction: ltr; text-align: center; user-select: all; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--card2);
  border: 1px solid var(--line2); border-radius: 12px; padding: 10px 16px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.loading { color: var(--soft); padding: 30px; text-align: center; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--orange); }
input.price { width: 100px; text-align: end; }

.nowrap { white-space: nowrap; }
@media (max-width: 720px) {
  .topbar-inner { gap: 8px; padding: 0 10px; }
  .iconbtn { padding: 5px 8px; }
  .user-btn { display: none; }
  .tenant-pill { max-width: 38vw; }
  main { padding: 16px 12px 50px; }
}
