/* Tasbeeh Admin Console — Royal Islamic Emerald & Gold + MesueTech Admin Architecture (modeled on HLO Admin) */
:root {
  --bg: #f6f4ef;
  --soft: #ece7dc;
  --card: #fffdf8;
  --line: rgba(16, 40, 28, .12);
  --tx: #0d1f17;
  --mut: #5c6e64;
  --ac: #0d6e4c;
  --ac2: #b88917;
  --acs: rgba(13, 110, 76, .10);
  --red: #dc2626;
  --org: #d97706;
  --grn: #16a34a;
  --r: 16px;
  --grad: linear-gradient(125deg, #0d6e4c, #b88917);
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

:root.dark, body.dark {
  --bg: #06120d;
  --soft: #0a1c15;
  --card: #0f261d;
  --line: rgba(212, 175, 55, .22);
  --tx: #f5f0e1;
  --mut: #9db8ab;
  --ac: #d4af37;
  --ac2: #e6c65c;
  --acs: rgba(212, 175, 55, .14);
  --grad: linear-gradient(125deg, #d4af37, #9a7418);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--ac); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 3rem; text-align: center; color: var(--mut); }

.shell {
  display: grid;
  grid-template-columns: 255px 1fr;
  min-height: 100vh;
}
nav {
  background: var(--soft);
  border-inline-end: 1px solid var(--line);
  padding: 1rem .75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  overflow-y: auto;
}
.brand {
  font-weight: 800;
  font-size: 1.15rem;
  padding: .4rem .7rem 1rem;
  color: var(--ac);
  display: flex;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: .5rem;
}
nav a {
  display: flex;
  gap: .6rem;
  align-items: center;
  padding: .65rem .85rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--tx);
  font-size: .92rem;
  transition: all .18s ease;
}
nav a.on, nav a:hover {
  background: var(--acs);
  color: var(--ac);
  font-weight: 700;
}
nav .sp { flex: 1; }

main {
  padding: 1.4rem 1.8rem;
  max-width: 1320px;
  width: 100%;
}
h1 { font-size: 1.45rem; margin: 0 0 .8rem; color: var(--ac); }
h2 { font-size: 1.05rem; margin: 0 0 .7rem; color: var(--ac2); }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .8rem;
  margin-bottom: 1.1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
.kpi b {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--ac);
}
.kpi span {
  color: var(--mut);
  font-size: .84rem;
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: .9rem;
  margin-bottom: 1rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
th, td {
  text-align: start;
  padding: .6rem .55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  color: var(--mut);
  font-weight: 700;
  font-size: .8rem;
}
.bar {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: .9rem;
}
input, select, textarea {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .55rem .75rem;
  width: 100%;
}
.bar input, .bar select {
  width: auto;
  flex: 1 1 200px;
}
.btn {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 10px;
  padding: .5rem .95rem;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  transition: all .18s ease;
}
.btn:hover { border-color: var(--ac); }
.btn.pri {
  background: var(--grad);
  color: #06120d;
  border: 0;
}
.btn.dng {
  color: #ff8a8a;
  border-color: rgba(220, 38, 38, .4);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tag {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 99px;
  font-size: .76rem;
  font-weight: 700;
  background: var(--acs);
  color: var(--ac);
}
.tag.ok { background: rgba(22, 163, 74, .18); color: #6ee7b7; }
.tag.warn { background: rgba(217, 119, 6, .18); color: #fcd34d; }
.tag.scam { background: rgba(220, 38, 38, .18); color: #fca5a5; }

.mut { color: var(--mut); }
.num {
  direction: ltr;
  unicode-bidi: embed;
  font-family: ui-monospace, monospace;
  font-size: .85rem;
}
.login {
  max-width: 400px;
  margin: 12vh auto;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.err { color: #ff8a8a; min-height: 1.2em; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  margin-bottom: .8rem;
}
.preview-thumb {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  border: 1.5px solid var(--ac);
  background: #06120d;
}

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  nav {
    position: static;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: .6rem;
  }
  nav a { white-space: nowrap; }
  .brand { display: none; }
  main { padding: 1rem; }
}
