/* =========================================================
   Admin Panel — Dark + Gold
   ========================================================= */
:root {
  --bg: #06070b;
  --panel: #0e1119;
  --gold: #d4af37;
  --gold-2: #f6d878;
  --gold-3: #a8842a;
  --green: #2ecc71;
  --red: #e74c3c;
  --text: #eae7de;
  --muted: #9b968b;
  --line: rgba(212, 175, 55, 0.16);
  --radius: 16px;
  --font: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 700px at 80% -10%, #1a1407, transparent 60%), var(--bg);
  color: var(--text); direction: rtl; min-height: 100vh; line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
input, textarea, select, button { font-family: inherit; }
::selection { background: var(--gold); color: #0a0c12; }
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--gold-3), var(--gold)); border-radius: 10px; }

.gold-text { background: linear-gradient(120deg, #a8842a, #f6d878 45%, #d4af37); -webkit-background-clip: text; background-clip: text; color: transparent; }
.container { width: min(1150px, 94%); margin-inline: auto; }

/* ---------- LOGIN PAGE ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); padding: 44px 36px; border-radius: 24px;
  background: linear-gradient(170deg, #12151f, #0a0c13);
  border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  text-align: center;
}
.login-logo {
  width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 20px;
  display: grid; place-items: center; font-size: 34px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-3));
  color: #0a0c12; box-shadow: 0 10px 30px rgba(212,175,55,0.4);
}
.login-card h1 { font-size: 24px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.form-group { text-align: right; margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.input {
  width: 100%; padding: 13px 18px; border-radius: 12px; color: var(--text);
  background: rgba(255,255,255,0.04); border: 1.5px solid rgba(255,255,255,0.1);
  transition: border-color 0.3s, box-shadow 0.3s; font-size: 15px;
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(212,175,55,0.12); }
.btn {
  width: 100%; padding: 14px; border: 0; border-radius: 12px; font-size: 16px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); color: #0a0c12;
  cursor: pointer; transition: transform 0.3s, box-shadow 0.3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(212,175,55,0.35); }
.back-link { display: inline-block; margin-top: 22px; color: var(--muted); font-size: 13px; transition: color 0.3s; }
.back-link:hover { color: var(--gold-2); }

/* Alert flash */
.alert { padding: 13px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; margin-bottom: 20px; text-align: right; }
.alert.success { background: rgba(46,204,113,0.12); color: var(--green); border: 1px solid rgba(46,204,113,0.35); }
.alert.error { background: rgba(231,76,60,0.12); color: var(--red); border: 1px solid rgba(231,76,60,0.35); }

/* ---------- DASHBOARD ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7,8,13,0.85); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.topbar-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.topbar-brand .mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); color: #0a0c12; font-size: 20px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.chip {
  padding: 8px 16px; border-radius: 30px; font-size: 13px; font-weight: 700;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--muted);
}
.chip b { color: var(--gold-2); }
.btn-sm { width: auto; padding: 9px 18px; font-size: 13px; border-radius: 10px; }
.btn-outline { background: transparent; color: var(--gold-2); border: 1.5px solid var(--gold); }
.btn-outline:hover { background: rgba(212,175,55,0.1); }
.btn-danger { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.btn-green { background: linear-gradient(135deg, #2ecc71, #27ae60); }

.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 34px 0 26px; flex-wrap: wrap; }
.dash-head h1 { font-size: 26px; }
.dash-head p { color: var(--muted); font-size: 14px; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 34px; }
.stat-card {
  padding: 22px; border-radius: var(--radius);
  background: linear-gradient(165deg, var(--panel), rgba(14,17,25,0.4));
  border: 1px solid var(--line); transition: transform 0.3s, border-color 0.3s;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.stat-card .num { font-size: 32px; font-weight: 800; }
.stat-card .lbl { color: var(--muted); font-size: 13px; }

.card {
  background: linear-gradient(170deg, var(--panel), rgba(14,17,25,0.4));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 30px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.card-head h2 { font-size: 19px; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.fbtn {
  padding: 7px 16px; border-radius: 30px; font-size: 13px; font-weight: 700; cursor: pointer;
  background: transparent; border: 1.5px solid var(--line); color: var(--muted); transition: all 0.3s;
}
.fbtn:hover { color: var(--gold-2); border-color: var(--gold); }
.fbtn.active { background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); color: #0a0c12; border-color: transparent; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 14px; text-align: right; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 14px; }
th { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
tbody tr { transition: background 0.3s; }
tbody tr:hover { background: rgba(212,175,55,0.04); }
td.title-cell { font-weight: 700; max-width: 260px; }
td.title-cell span { color: var(--muted); font-weight: 400; font-size: 12px; display: block; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 30px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.tip { background: rgba(212,175,55,0.14); color: var(--gold-2); }
.badge.signal { background: rgba(46,204,113,0.12); color: var(--green); }
.badge.analysis { background: rgba(52,152,219,0.12); color: #5dade2; }
.badge.buy { background: rgba(46,204,113,0.12); color: var(--green); }
.badge.sell { background: rgba(231,76,60,0.12); color: var(--red); }
.badge.st-active { background: rgba(46,204,113,0.12); color: var(--green); }
.badge.st-waiting { background: rgba(240,173,78,0.12); color: #f0ad4e; }
.badge.st-closed { background: rgba(255,255,255,0.06); color: var(--muted); }
.badge.feat { background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); color: #0a0c12; }

.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.act {
  padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text);
  transition: all 0.3s;
}
.act:hover { border-color: var(--gold); color: var(--gold-2); }
.act.del:hover { border-color: var(--red); color: var(--red); background: rgba(231,76,60,0.1); }

/* ---------- FORM PAGE ---------- */
.form-page { padding: 40px 0 80px; }
.form-card { max-width: 760px; margin-inline: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group select, .form-group textarea { font-size: 15px; }
.form-group textarea { min-height: 180px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.form-actions .btn { width: auto; padding: 13px 30px; }
.checkbox-line { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-top: 6px; cursor: pointer; }
.checkbox-line input { width: 18px; height: 18px; accent-color: var(--gold); }

/* Responsive */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .topbar-inner { justify-content: center; }
}
