/* Adonis Hub — Admin & Publisher dashboards */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

.dashboard-page {
  --gold: #ffbd59;
  --gold-hover: #e6a845;
  --gold-dim: rgba(255, 189, 89, 0.12);
  --black: #0c0c0c;
  --black-soft: #161616;
  --primary: #c9922e;
  --primary-hover: #b07d22;
  --bg: #f4f2ed;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: rgba(0, 0, 0, 0.08);
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  --font: 'Tajawal', system-ui, sans-serif;
}

.dashboard-page * {
  box-sizing: border-box;
  font-family: var(--font);
}

.dashboard-page body,
body.dashboard-page {
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0 20px 48px;
  min-height: 100vh;
}

.dashboard-page .dash-wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.dashboard-page .header {
  max-width: 1280px;
  margin: 20px auto 24px;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--black-soft) 0%, #1f1a14 100%);
  color: #fff;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 189, 89, 0.2);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard-page .header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dashboard-page .header-brand img {
  height: 42px;
  width: auto;
}

.dashboard-page .header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.dashboard-page .header-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
}

.dashboard-page .header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-page .btn-site {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 189, 89, 0.15);
  border: 1px solid rgba(255, 189, 89, 0.35);
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: 0.2s;
}

.dashboard-page .btn-site:hover {
  background: rgba(255, 189, 89, 0.28);
}

.dashboard-page #login-section {
  max-width: 420px;
  margin: 60px auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
}

.dashboard-page #login-section h2 {
  color: var(--black);
  margin-top: 0;
}

.dashboard-page #login-section .login-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--gold-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--primary);
}

.dashboard-page #app-section {
  display: none;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.dashboard-page .card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
}

.dashboard-page .card h2 {
  margin: 0 0 20px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--black);
  border-bottom: 2px solid var(--gold-dim);
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-page .card h2 i {
  color: var(--primary);
}

.dashboard-page .card-pending {
  border-color: rgba(255, 189, 89, 0.45);
  background: linear-gradient(180deg, #fffdf8 0%, #fff 100%);
}

.dashboard-page .form-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 960px) {
  .dashboard-page .form-layout {
    grid-template-columns: 1fr;
  }
}

.dashboard-page .panel-ar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.dashboard-page .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gold-dim);
}

.dashboard-page .panel-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--black);
}

.dashboard-page .panel-badge {
  font-size: 0.75rem;
  background: var(--gold-dim);
  color: #8a6420;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.dashboard-page .btn-translate {
  background: linear-gradient(135deg, var(--gold) 0%, #e6a845 100%);
  color: var(--black);
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s;
  box-shadow: 0 4px 14px rgba(255, 189, 89, 0.35);
}

.dashboard-page .btn-translate:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.dashboard-page .btn-translate:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.dashboard-page .hint-ar-only {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 16px;
  padding: 10px 14px;
  background: #faf8f4;
  border-radius: 10px;
  border-right: 3px solid var(--gold);
}

.dashboard-page .form-group {
  margin-bottom: 16px;
  text-align: right;
}

.dashboard-page label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.88rem;
  color: #444;
}

.dashboard-page input[type="text"],
.dashboard-page input[type="email"],
.dashboard-page input[type="number"],
.dashboard-page input[type="date"],
.dashboard-page textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 0.95rem;
  transition: 0.2s;
  background: #fff;
}

.dashboard-page input:focus,
.dashboard-page textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.dashboard-page .sidebar-panel {
  background: linear-gradient(180deg, #faf8f5 0%, #fff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 20px;
}

.dashboard-page .sidebar-panel h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 800;
}

.dashboard-page .btn-primary {
  background: linear-gradient(135deg, var(--black-soft) 0%, #2a2418 100%);
  color: var(--gold);
  border: 1px solid rgba(255, 189, 89, 0.3);
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  transition: 0.2s;
}

.dashboard-page .btn-primary:hover {
  border-color: var(--gold);
}

.dashboard-page .btn-google {
  background: #fff;
  color: #444;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dashboard-page .lists-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .dashboard-page .lists-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-page .list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  transition: 0.2s;
  background: #fff;
}

.dashboard-page .list-item:hover {
  border-color: rgba(255, 189, 89, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dashboard-page .list-item-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.dashboard-page .list-item img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.dashboard-page .list-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-page .list-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.dashboard-page .actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-page .btn-edit,
.dashboard-page .btn-danger {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  color: #fff;
}

.dashboard-page .btn-edit {
  background: var(--success);
}

.dashboard-page .btn-danger {
  background: var(--danger);
}

.dashboard-page #en-preview-panel {
  margin-top: 16px;
  border: 1px dashed #ccc;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f9f9f9;
}

.dashboard-page #en-preview-panel.is-filled {
  border-color: rgba(255, 189, 89, 0.5);
}

.dashboard-page .en-preview-toggle {
  width: 100%;
  padding: 12px 16px;
  background: #eee;
  border: none;
  text-align: right;
  font-weight: 700;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-page #en-preview-panel.is-open .en-preview-body,
.dashboard-page #en-preview-panel.is-filled .en-preview-body {
  display: block;
}

.dashboard-page .en-preview-body {
  display: none;
  padding: 16px;
  direction: ltr;
  text-align: left;
}

.dashboard-page .en-preview-body input,
.dashboard-page .en-preview-body textarea {
  background: #f3f3f3;
  color: #555;
  cursor: default;
}

.dashboard-page .en-field-readonly {
  margin-bottom: 12px;
}

.dashboard-page .en-field-readonly label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
}

.dashboard-page .ql-container {
  font-family: var(--font);
  min-height: 280px;
  background: #f5f5f5;
  border-radius: 0 0 10px 10px;
}

.dashboard-page .ql-editor {
  min-height: 260px;
}

.dashboard-page .ql-toolbar {
  border-radius: 10px 10px 0 0;
  background: #ebebeb;
  direction: ltr;
}

.dashboard-page .user-info img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold);
}

.dashboard-page .btn-logout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.dashboard-page .settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.dashboard-page .image-preview {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 8px;
  display: none;
}

.dashboard-page .loader {
  display: none;
  width: 22px;
  height: 22px;
  border: 3px solid var(--gold);
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: dashSpin 0.8s linear infinite;
}

.dashboard-page .loader-white {
  border-color: #fff;
  border-bottom-color: transparent;
}

@keyframes dashSpin {
  to { transform: rotate(360deg); }
}

.dashboard-page .card-site-copy {
  max-width: 100%;
}

.dashboard-page .site-copy-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.dashboard-page .copy-row label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.dashboard-page .copy-row__inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dashboard-page .copy-row__inputs input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .dashboard-page .copy-row__inputs {
    grid-template-columns: 1fr;
  }
}

.dashboard-page #toast-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-page .toast {
  min-width: 280px;
  max-width: 400px;
  padding: 14px 16px;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  animation: toastIn 0.35s ease;
}

.dashboard-page .toast-success { background: #14532d; color: #bbf7d0; }
.dashboard-page .toast-error { background: #7f1d1d; color: #fecaca; }
.dashboard-page .toast-warning { background: #78350f; color: #fde68a; }
.dashboard-page .toast-info { background: #1e3a5f; color: #bfdbfe; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: none; }
}

.dashboard-page .toast-hide {
  opacity: 0;
  transition: opacity 0.3s;
}

.dashboard-publisher .panel-ar {
  max-width: 100%;
}

.dashboard-publisher .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .dashboard-page .form-row-2 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   MERGED: Toast notifications (from custom-style-2)
   ============================================================ */
#toast-container { position: fixed; top: 80px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
html[lang="ar"] #toast-container { right: auto; left: 20px; }
.toast { min-width: 280px; max-width: 360px; padding: 16px 20px 16px 16px; border-radius: 12px; display: flex; align-items: flex-start; gap: 13px; box-shadow: 0 8px 32px rgba(0,0,0,0.22); pointer-events: all; animation: toastIn 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards; font-family: inherit; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.12); position: relative; overflow: hidden; }
.toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 12px 0 0 12px; }
html[lang="ar"] .toast::before { left: auto; right: 0; border-radius: 0 12px 12px 0; }
.toast.toast-success { background: rgba(15,25,20,0.95); color: #d1fae5; }
.toast.toast-success::before { background: #10b981; }
.toast.toast-error { background: rgba(25,10,12,0.95); color: #fee2e2; }
.toast.toast-error::before { background: #ef4444; }
.toast.toast-warning { background: rgba(25,20,5,0.95); color: #fef3c7; }
.toast.toast-warning::before { background: #f59e0b; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 3px; }
.toast-msg { font-size: 0.85rem; opacity: 0.85; }
.toast-close { background: none; border: none; cursor: pointer; color: inherit; opacity: 0.5; font-size: 1.1rem; padding: 0; flex-shrink: 0; transition: opacity 0.2s; }
.toast.toast-hide { animation: toastOut 0.35s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(50px) scale(0.92); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.88); } }

/* ============================================================
   Admin — Overview KPIs + News ticker settings
   ============================================================ */
.dashboard-page .card-lead {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: -4px 0 18px;
  line-height: 1.65;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.admin-kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.admin-kpi-card--gold {
  border-color: rgba(255, 189, 89, 0.35);
  background: linear-gradient(135deg, #fffdf8 0%, #fff 100%);
}

.admin-kpi-card--warn {
  border-color: rgba(249, 115, 22, 0.25);
}

.admin-kpi-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gold-dim);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.admin-kpi-card--warn .admin-kpi-card__icon {
  background: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}

.admin-kpi-card__label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.admin-kpi-card__value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.admin-quick-actions__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.admin-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s;
  font-family: inherit;
}

.admin-quick-btn:hover {
  border-color: rgba(255, 189, 89, 0.45);
  background: var(--gold-dim);
  color: var(--primary);
}

.admin-quick-btn i {
  font-size: 1.25rem;
  color: var(--primary);
}

.admin-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.admin-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.ticker-admin-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .ticker-admin-cols {
    grid-template-columns: 1fr;
  }
}

.ticker-admin-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ticker-admin-col__head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.btn-add-row {
  border: 1px dashed rgba(201, 146, 46, 0.5);
  background: var(--gold-dim);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}

.ticker-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticker-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ticker-row__input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.ticker-row__remove {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  cursor: pointer;
  flex-shrink: 0;
}

.ticker-preview {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.08), rgba(255, 189, 89, 0.12));
  border: 1px solid rgba(124, 58, 237, 0.15);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  font-size: 0.82rem;
}

.ticker-preview ul {
  margin: 8px 0 0;
  padding-inline-start: 18px;
  line-height: 1.6;
}

.ticker-preview__col strong {
  display: block;
  margin-bottom: 6px;
}

.ticker-preview__line {
  margin: 0;
  line-height: 1.65;
  color: var(--text);
}

.ticker-preview .muted {
  color: var(--text-muted);
  list-style: none;
  padding: 0;
}

.card-news-ticker {
  border-color: rgba(124, 58, 237, 0.2);
}

@media (max-width: 640px) {
  .ticker-preview {
    grid-template-columns: 1fr;
  }
}
