/* ============================================================
   Waqas Mir — Dashboard
   Reuses the design tokens from styles.css.
   ============================================================ */

.dash-body { min-height: 100vh; display: flex; flex-direction: column; }

/* Top bar */
.dash-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.dash-top .logo { font-size: 1.1rem; }
.dash-top .spacer { flex: 1; }
.dash-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-dim);
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
}
.dash-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.dash-status.dirty { color: #eab308; }
.dash-status.dirty .dot { background: #eab308; box-shadow: 0 0 10px rgba(234,179,8,.6); }
.dash-status.clean { color: #22c55e; }
.dash-status.clean .dot { background: #22c55e; }

.dash-wrap { width: min(100% - 40px, 1100px); margin: 28px auto 60px; flex: 1; }

/* Tabs */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.tabs button {
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim); font-weight: 600; font-size: 0.9rem; cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: #fff; background: var(--accent-grad); border-color: transparent; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .35s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Section heading inside panels */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--font-display); font-size: 1.4rem; }
.panel-head p { color: var(--text-dim); font-size: .9rem; }

/* Cards / forms */
.card-box {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 22px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 7px; color: var(--text-dim); }
.field input[type=text], .field input[type=url], .field input[type=email], .field input[type=number], .field textarea {
  width: 100%; padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-2); color: var(--text);
  font-family: inherit; font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent-1);
  box-shadow: 0 0 0 3px var(--glow);
}
.field textarea { resize: vertical; min-height: 84px; }
.field .hint { font-size: .78rem; color: var(--text-faint); margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent-1); }

/* Project list rows */
.proj-list { display: grid; gap: 14px; }
.proj-row {
  display: grid; grid-template-columns: 88px 1fr auto; gap: 16px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 14px;
}
.proj-row .pthumb {
  width: 88px; height: 60px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700;
  color: #fff; background: var(--accent-grad);
}
.proj-row .pthumb img { width: 100%; height: 100%; object-fit: cover; }
.proj-row .pinfo h3 { font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.proj-row .pinfo .star { color: #eab308; font-size: .9rem; }
.proj-row .pinfo p { color: var(--text-dim); font-size: .85rem; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.proj-row .pinfo .ptags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.proj-row .pinfo .ptags span { font-size: .68rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); }
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions button {
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text-dim);
  display: grid; place-items: center; font-size: 1.1rem;
  transition: color .2s, border-color .2s, transform .2s;
}
.row-actions button:hover { color: var(--text); border-color: var(--accent-1); transform: translateY(-2px); }
.row-actions button.danger:hover { color: #ef4444; border-color: #ef4444; }

/* Editor modal */
.editor {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
}
.editor.open { display: flex; }
.editor-card {
  width: min(900px, 100%); max-height: 90vh; overflow: auto;
  background: var(--bg-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-2);
}
.editor-grid { display: grid; grid-template-columns: 1fr 0.9fr; gap: 0; }
.editor-form { padding: 24px; }
.editor-preview { border-left: 1px solid var(--border); padding: 24px; background: var(--surface); }
.editor-preview h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); margin-bottom: 12px; }
.preview-frame {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
  aspect-ratio: 16/10; background: #fff; margin-bottom: 14px;
}
.preview-frame iframe { width: 100%; height: 100%; border: 0; }
.preview-empty { display: grid; place-items: center; height: 100%; color: var(--text-faint); font-size: .85rem; text-align: center; padding: 16px; }
.editor-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.editor-head h3 { font-family: var(--font-display); font-size: 1.2rem; }
.editor-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 18px 24px; border-top: 1px solid var(--border); }

/* Buttons reused from styles.css; add a subtle one */
.btn-soft { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); border-radius: 999px; padding: 11px 18px; font-weight: 600; cursor: pointer; transition: border-color .2s, transform .2s; }
.btn-soft:hover { border-color: var(--accent-1); transform: translateY(-2px); }
.btn-danger { background: transparent; border: 1px solid #ef4444; color: #ef4444; border-radius: 999px; padding: 11px 18px; font-weight: 600; cursor: pointer; }
.btn-danger:hover { background: #ef4444; color: #fff; }

/* Export output */
.export-box { margin-top: 16px; }
.export-box textarea {
  width: 100%; min-height: 220px; font-family: ui-monospace, monospace; font-size: .82rem;
  padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-2); color: var(--text); resize: vertical;
}
.callout {
  border: 1px solid var(--border); border-left: 3px solid var(--accent-1);
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 14px 16px; color: var(--text-dim); font-size: .9rem; margin-bottom: 18px;
}
.callout strong { color: var(--text); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .9rem;
  box-shadow: var(--shadow-2); opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease); z-index: 80;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Gate */
.gate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--bg); padding: 20px; }
.gate.hidden { display: none; }
.gate-card { width: min(400px, 100%); text-align: center; }
.gate-card .lock { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; background: var(--accent-grad); color: #fff; font-size: 1.8rem; }
.gate-card h1 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 8px; }
.gate-card p { color: var(--text-dim); font-size: .9rem; margin-bottom: 18px; }
.gate-card input { text-align: center; }

@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-preview { border-left: 0; border-top: 1px solid var(--border); }
  .proj-row { grid-template-columns: 64px 1fr; }
  .proj-row .pthumb { width: 64px; height: 48px; }
  .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
