/* Alsherif Co. H.S. V.L. - admin panel */

:root {
  --bg: #05080f;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eaf0ff;
  --muted: #9aa6c4;
  --muted-2: #78849f;
  --teal: #5eead4;
  --cyan: #4cc9f0;
  --violet: #7b61ff;
  --danger: #ff7b7b;
  --grad: linear-gradient(115deg, #5eead4 0%, #4cc9f0 45%, #7b61ff 100%);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.03em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

.orb { position: fixed; width: 700px; height: 700px; border-radius: 50%; top: -320px; right: -220px; background: radial-gradient(circle, rgba(76, 201, 240, 0.22), transparent 62%); filter: blur(70px); pointer-events: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 10px; border: 1px solid transparent; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease; white-space: nowrap; }
.btn-primary { background: var(--grad); color: #04121a; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-2); background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-danger { border-color: rgba(255, 123, 123, 0.35); color: #ffb3b3; background: rgba(255, 123, 123, 0.08); }
.btn-danger:hover { background: rgba(255, 123, 123, 0.16); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.link-btn { background: none; border: 0; color: var(--cyan); font-size: 13px; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.icon-btn:hover { color: var(--text); background: var(--panel-2); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 40px 20px; }
.login-card {
  width: min(100%, 400px); padding: 34px 30px; border-radius: 20px;
  border: 1px solid var(--line-2);
  background: linear-gradient(170deg, rgba(16, 23, 39, 0.95), rgba(7, 11, 20, 0.97));
  box-shadow: 0 50px 100px -60px rgba(76, 201, 240, 0.8);
  display: grid; gap: 14px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-brand img { border-radius: 13px; }
.login-brand strong { display: block; font-size: 13px; letter-spacing: 0.1em; }
.login-brand span { font-size: 11.5px; color: var(--muted-2); letter-spacing: 0.08em; text-transform: uppercase; }
.login h1 { font-size: 1.7rem; }
.login-sub { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.login-status { font-size: 13.5px; color: var(--danger); min-height: 20px; }
.login-status.ok { color: var(--teal); }
.login-back { font-size: 13px; color: var(--muted-2); margin-top: 4px; }
.login-back:hover { color: var(--text); }

/* fields */
.field { display: grid; gap: 6px; }
.field > span { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3); color: var(--text); font: inherit; font-size: 14.5px;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(76, 201, 240, 0.6); outline: none; background: rgba(0, 0, 0, 0.45); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); padding-top: 6px; }
.check input { width: 17px; height: 17px; accent-color: var(--cyan); }

/* shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; min-width: 0; }
.side {
  min-width: 0;
  position: sticky; top: 0; height: 100vh; padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 18, 31, 0.9), rgba(5, 8, 15, 0.95));
  display: flex; flex-direction: column; gap: 26px;
}
.side-brand { display: flex; align-items: center; gap: 11px; }
.side-brand img { border-radius: 11px; }
.side-brand strong { display: block; font-size: 12.5px; letter-spacing: 0.1em; }
.side-brand span { font-size: 11px; color: var(--muted-2); letter-spacing: 0.14em; text-transform: uppercase; }
.side-nav { display: grid; gap: 4px; min-width: 0; }
.side-nav button {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 10px; border: 1px solid transparent;
  background: none; color: var(--muted); font-size: 14px; cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.side-nav button svg { width: 18px; height: 18px; flex: none; }
.side-nav button:hover { background: var(--panel); color: var(--text); }
.side-nav button.active { background: linear-gradient(100deg, rgba(76, 201, 240, 0.16), rgba(123, 97, 255, 0.1)); border-color: rgba(76, 201, 240, 0.3); color: var(--text); }
.side-nav em { margin-left: auto; font-style: normal; font-size: 11px; background: var(--grad); color: #04121a; border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.side-nav em:empty { display: none; }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13.5px; }
.side-foot a, .side-foot button { color: var(--muted); background: none; border: 0; text-align: left; padding: 6px 0; cursor: pointer; font-size: 13.5px; }
.side-foot a:hover, .side-foot button:hover { color: var(--text); }

.dash { padding: 30px 34px 70px; min-width: 0; }
.dash-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.dash-kicker { font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 6px; }
.dash-top h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.dash-actions { display: flex; gap: 10px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat {
  padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
}
.stat span { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.stat strong { display: block; font-size: 1.9rem; letter-spacing: -0.03em; margin-top: 6px; line-height: 1; }
.stat.hot strong { color: var(--teal); }

.cols { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; align-items: start; }
.card {
  border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px;
  background: rgba(255, 255, 255, 0.028);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 1rem; letter-spacing: -0.01em; }
.hint { color: var(--muted-2); font-size: 12.5px; }

/* list rows */
.list { display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 1.1fr 1.4fr auto; gap: 14px; align-items: center;
  padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
}
.row:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.04); }
.row-main { min-width: 0; }
.row-title { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-sub { font-size: 12.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-body { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-side { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions { display: flex; gap: 6px; }
.list.wide .row { grid-template-columns: 1.05fr 1.5fr auto; }

.badge { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.badge.new { color: #04121a; background: var(--teal); border-color: transparent; }
.badge.read { color: var(--muted); }
.badge.replied { color: var(--teal); border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.08); }
.badge.archived { color: var(--muted-2); opacity: 0.75; }
.badge.live, .badge.active { color: var(--teal); border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.08); }
.badge.building { color: #ffd166; border-color: rgba(255, 209, 102, 0.32); background: rgba(255, 209, 102, 0.08); }
.badge.care, .badge.paused { color: #b9a6ff; border-color: rgba(123, 97, 255, 0.35); background: rgba(123, 97, 255, 0.1); }
.badge.hidden, .badge.ended { color: var(--muted-2); }
.badge.popular { color: #04121a; background: var(--grad); border-color: transparent; }

/* feed */
.feed { display: grid; gap: 0; }
.feed li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.feed li:last-child { border-bottom: 0; }
.feed .tick { width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px rgba(76, 201, 240, 0.6); }
.feed b { font-weight: 600; font-size: 13.5px; }
.feed span { display: block; font-size: 12.5px; color: var(--muted-2); }

/* toolbar + chips */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.active { background: var(--grad); color: #04121a; border-color: transparent; font-weight: 600; }

.empty { padding: 26px; text-align: center; color: var(--muted-2); font-size: 14px; border: 1px dashed var(--line-2); border-radius: 12px; }

/* form card */
.form { display: grid; gap: 14px; }
.form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.status { font-size: 13px; color: var(--muted); }
.status.ok { color: var(--teal); }
.status.err { color: var(--danger); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(3, 5, 10, 0.72); backdrop-filter: blur(6px); }
.modal-card {
  width: min(100%, 560px); max-height: 90vh; overflow: auto; padding: 24px;
  border-radius: 18px; border: 1px solid var(--line-2);
  background: linear-gradient(170deg, #0d1524, #070b14);
  box-shadow: 0 50px 100px -50px rgba(0, 0, 0, 0.9);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { font-size: 1.2rem; }
.fields { display: grid; gap: 13px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 999px; font-size: 14px; z-index: 200;
  background: #0e1727; border: 1px solid rgba(94, 234, 212, 0.35); color: var(--teal);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.9);
}
.toast.err { border-color: rgba(255, 123, 123, 0.4); color: #ffb3b3; }

@media (max-width: 1020px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap;
    align-items: center; gap: 10px 14px; padding: 12px 16px;
    border-right: 0; border-bottom: 1px solid var(--line);
    background: rgba(6, 10, 18, 0.96); backdrop-filter: blur(12px);
  }
  .side-brand { flex: none; order: 1; }
  .side-foot { order: 2; margin: 0 0 0 auto; padding: 0; border: 0; display: flex; gap: 14px; flex: none; }
  .side-foot a, .side-foot button { padding: 0; }
  .side-nav { order: 3; width: 100%; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav button { white-space: nowrap; padding: 8px 12px; width: auto; }
  .dash { padding: 22px 18px 60px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .row, .list.wide .row { grid-template-columns: 1fr; gap: 10px; }
  .row-side { justify-content: flex-start; }
  .field-row { grid-template-columns: 1fr; }
  .side-brand strong { font-size: 11.5px; }
  .side-brand span { display: none; }
  .side-nav button { font-size: 13px; }
  .side-nav button svg { width: 17px; height: 17px; }
  .dash-top h1 { font-size: 1.4rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat strong { font-size: 1.6rem; }
}
.row-body.full { display: block; -webkit-line-clamp: unset; overflow: visible; line-height: 1.8; }
.row-body code { background: rgba(255,255,255,0.07); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; word-break: break-all; }

/* v3: accounts, payments, AI assistant */
.ai-chat { display: grid; gap: 10px; max-height: 440px; min-height: 200px; overflow: auto; padding: 8px 2px 14px; }
.ai-chat .bubble { max-width: 84%; padding: 11px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; }
.ai-chat .bubble.me { justify-self: end; background: linear-gradient(120deg, #4cc9f0, #7b61ff); color: #05101a; font-weight: 600; }
.ai-chat .bubble.ai { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); }
.ai-chat .applied { font-size: 12px; color: var(--teal); margin-top: 6px; }
.ai-form { display: flex; gap: 10px; }
.ai-form textarea { flex: 1; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(5,8,18,.6); color: var(--text); font: inherit; resize: none; }
.pay-settings { margin-bottom: 8px; }

/* v4: payment screenshots */
.proof-thumb { display: block; max-width: 260px; max-height: 220px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); margin-top: 8px; }
.row-actions { flex-wrap: wrap; }
.row > * { min-width: 0; }

/* v5: site files modal */
.files-list { display: grid; gap: 6px; margin: 10px 0; max-height: 46vh; overflow: auto; }
.files-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; }
.files-name { flex: 1; min-width: 0; word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.files-size { color: var(--muted, #9aa6c4); font-size: 12px; white-space: nowrap; }

/* v7: our work */
.wk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px;margin-top:14px}
.wk-item{margin:0;border:1px solid var(--line,rgba(255,255,255,.12));border-radius:14px;overflow:hidden;background:rgba(255,255,255,.04)}
.wk-item img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block;background:#0b1020}
.wk-item figcaption{display:flex;flex-direction:column;gap:6px;padding:10px}
.wk-item figcaption span{color:#9aa6c4;font-size:13px}
.wk-review{display:flex;flex-direction:column;gap:10px;margin-top:10px}.wk-prev{max-width:320px;border-radius:12px}.wk-info{white-space:pre-line;font-size:13px}.wk-item textarea{width:100%}
