/* ============================================================
   hala click — Admin Panel Styles
   ============================================================ */

* { box-sizing: border-box; }

:root {
  --pink:    #ff4d8d;
  --purple:  #8a4dff;
  --purple-d:#6d3ad6;
  --ink:     #1a0b2e;
  --ink-2:   #3a2358;
  --ink-3:   #6b5a87;
  --line:    #ece5fb;
  --bg:      #f6f3fc;
  --grad:    linear-gradient(135deg, #ff4d8d 0%, #8a4dff 60%, #6d3ad6 100%);
  --grad-soft: linear-gradient(135deg, #ffe1ee 0%, #ece1ff 100%);
  --shadow:  0 10px 30px rgba(138,77,255,.15);
}

html, body {
  margin: 0; padding: 0;
  font-family: "Cairo", "Tajawal", system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  min-height: 100vh;
}

/* ---------- Login screen ---------- */
.login-screen {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
}
.login-card {
  background: #fff; padding: 40px; border-radius: 22px;
  box-shadow: var(--shadow); max-width: 420px; width: 100%;
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--grad); color: #fff;
  display: grid; place-items: center;
  font-size: 2rem; font-weight: 900; margin: 0 auto 18px;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 1.5rem; margin: 0 0 8px; }
.login-card p { color: var(--ink-3); margin: 0 0 26px; }

/* ---------- Layout ---------- */
.admin-wrap { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px; background: var(--ink);
  color: #fff; padding: 28px 0; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px 28px; font-weight: 900; font-size: 1.3rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--grad); display: grid; place-items: center;
  font-weight: 900;
}
.tabs { list-style: none; padding: 16px 0; margin: 0; }
.tabs li {
  padding: 12px 24px; cursor: pointer; font-weight: 700;
  color: #cfc1eb; transition: all .2s;
  border-right: 3px solid transparent;
  display: flex; align-items: center; gap: 10px;
}
.tabs li:hover { color: #fff; background: rgba(255,255,255,.04); }
.tabs li.active {
  color: #fff; background: rgba(255,255,255,.06);
  border-right-color: var(--pink);
}
.tabs li .ico { width: 20px; text-align: center; }
.sidebar-foot {
  position: absolute; bottom: 20px; right: 24px; left: 24px;
  font-size: .85rem; color: rgba(255,255,255,.5);
}
.sidebar-foot a { color: #cfc1eb; text-decoration: none; }
.sidebar-foot a:hover { color: var(--pink); }

.main { flex: 1; min-width: 0; padding: 36px 40px; }
.main-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; gap: 16px;
}
.main-head h1 {
  font-size: 1.6rem; margin: 0;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.main-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700;
  font-family: inherit; font-size: .92rem;
  border: 0; cursor: pointer; transition: all .2s;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost {
  background: #fff; color: var(--purple-d);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--purple); }
.btn-danger {
  background: #fff; color: #d63364; border: 1.5px solid #f7c8da;
}
.btn-danger:hover { background: #fdecf3; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }

/* ---------- Cards / sections ---------- */
.card {
  background: #fff; border-radius: 16px;
  padding: 28px; margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(138,77,255,.08);
}
.card h2 {
  font-size: 1.1rem; margin: 0 0 4px;
  display: flex; align-items: center; gap: 8px;
}
.card .card-sub { color: var(--ink-3); font-size: .9rem; margin: 0 0 20px; }

/* ---------- Form ---------- */
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 6px;
  font-size: .88rem; font-weight: 700; color: var(--ink-2);
}
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff;
  font-family: inherit; font-size: .95rem; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 0; border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(138,77,255,.14);
}
.field input[type="color"] {
  height: 46px; padding: 4px; cursor: pointer;
}
.field .hint { font-size: .78rem; color: var(--ink-3); margin-top: 4px; }

/* ---------- Currency rates table ---------- */
.cur-table { width: 100%; border-collapse: collapse; }
.cur-table th, .cur-table td {
  padding: 12px 10px; text-align: right; border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.cur-table th {
  background: var(--bg); font-weight: 800; color: var(--ink-2);
  font-size: .82rem; text-transform: uppercase;
}
.cur-table .flag-cell { font-size: 1.4rem; }
.cur-table input {
  width: 110px; padding: 8px 10px; border-radius: 8px;
  border: 1.5px solid var(--line); font-family: inherit;
  font-size: .9rem; text-align: center;
}
.cur-table input:focus {
  outline: 0; border-color: var(--purple);
}
.cur-table .badge-base {
  background: var(--grad-soft); color: var(--purple-d);
  padding: 4px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 800;
}

/* ---------- Tab content ---------- */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--ink); color: #fff; padding: 14px 26px;
  border-radius: 999px; box-shadow: var(--shadow);
  font-weight: 700; font-size: .92rem;
  opacity: 0; transition: all .35s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: linear-gradient(90deg, #20c997, #0ea571); }
.toast.error   { background: linear-gradient(90deg, #f43f5e, #d63364); }

/* ---------- Code export modal ---------- */
.export-modal {
  position: fixed; inset: 0; background: rgba(26,11,46,.6);
  backdrop-filter: blur(6px); z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.export-modal.open { display: flex; }
.export-box {
  background: #fff; border-radius: 18px; padding: 28px;
  max-width: 720px; width: 100%; max-height: 88vh;
  overflow-y: auto;
}
.export-box h3 { margin: 0 0 8px; }
.export-box pre {
  background: var(--ink); color: #cfc1eb;
  padding: 18px; border-radius: 12px; overflow-x: auto;
  font-family: ui-monospace, "Menlo", monospace;
  font-size: .82rem; line-height: 1.6;
  max-height: 50vh; margin: 14px 0;
}
.export-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px;
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .admin-wrap { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; padding: 18px 0 0; }
  .sidebar .brand { padding: 0 18px 14px; }
  .tabs { display: flex; overflow-x: auto; padding: 8px 0; }
  .tabs li { white-space: nowrap; border-right: 0; border-bottom: 3px solid transparent; }
  .tabs li.active { border-right: 0; border-bottom-color: var(--pink); }
  .sidebar-foot { display: none; }
  .main { padding: 24px; }
  .row, .row-3 { grid-template-columns: 1fr; }
}
