/* ============================================================
   GEOX — Dashboard
   Sits on top of styles.css (landing theme).
   ============================================================ */
body.dash-page {
  background: var(--cream);
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans','Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  color: var(--ink);
}
.dash-top {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.dash-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  color: var(--ink);
}
.dash-brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--grad-red); color: #fff;
  display: grid; place-items: center; font-weight: 800;
}
.dash-top .spacer { flex: 1; }
.dash-account {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.dash-plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cream-2);
  color: var(--ink-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.dash-plan-chip.pro  { background: #FFF1D8; color: #9F5A00; border-color: #F5DAAF; }
.dash-plan-chip.team { background: #E3F1FF; color: #0A5A9A; border-color: #BBDDF7; }
.dash-btn {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.dash-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.dash-btn.primary {
  background: var(--grad-red);
  color: #fff;
  border-color: transparent;
}

.dash-shell {
  max-width: 1100px;
  margin: 32px auto 60px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.dash-welcome {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.dash-welcome h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}
.dash-welcome .sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.dash-welcome .grow { flex: 1; }

.dash-usage {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-2);
}
.dash-usage-bar {
  width: 160px; height: 8px;
  background: var(--cream-2); border-radius: 999px;
  overflow: hidden;
}
.dash-usage-fill {
  height: 100%;
  background: var(--grad-red);
  width: 0%;
  transition: width .3s;
}

.dash-projects {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.dash-projects-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.dash-projects-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.dash-projects-head .count {
  font-size: 12px; color: var(--muted);
  padding: 2px 8px; background: var(--cream-2);
  border-radius: 999px;
}
.dash-projects-head .grow { flex: 1; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.dash-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .12s, box-shadow .12s;
  position: relative;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Project map preview */
.dash-card .thumb {
  display: block;
  height: 132px;
  background:
    linear-gradient(0deg, rgba(230,85,63,0.04), rgba(230,85,63,0.04)),
    var(--cream-2);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.dash-card .thumb svg { width: 100%; height: 100%; display: block; }
.dash-card .thumb.thumb-empty {
  display: grid; place-items: center;
  color: var(--muted); font-size: 12px; font-weight: 600;
  letter-spacing: .02em;
}
.dash-card-body {
  padding: 13px 15px 15px;
  display: flex; flex-direction: column; gap: 6px;
}
.dash-card .name {
  font-weight: 700; font-size: 15px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-card .meta { font-size: 12px; color: var(--muted); }
.dash-card .tags {
  display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap;
}
.dash-card .tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink-2);
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.dash-card .tag.cloud { background: #E3F1FF; color: #0A5A9A; border-color: #BBDDF7; }
.dash-card .tag.local { background: #FFF1D8; color: #9F5A00; border-color: #F5DAAF; }
.dash-card .actions {
  display: flex; gap: 8px; margin-top: 10px;
}
.dash-card .actions a,
.dash-card .actions button {
  flex: 1;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
}
.dash-card .actions a:hover { background: var(--cream); }
.dash-card .actions .danger { color: var(--red-dark); }
.dash-empty {
  text-align: center; padding: 40px 12px; color: var(--muted); font-size: 14px;
}
.dash-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 10px;
  font-size: 13px; z-index: 9999;
  box-shadow: var(--shadow-md);
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.dash-toast.show { opacity: 1; }
.dash-toast.error { background: var(--red-dark); }
.dash-toast.success { background: #1F6B3E; }

.dash-danger {
  margin-top: 48px;
  padding: 20px 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.dash-danger h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.dash-danger .sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.dash-danger code {
  background: var(--cream); padding: 1px 5px; border-radius: 4px;
  font-size: 12px;
}
.dash-danger-row { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-btn.danger {
  background: #FDECEC; color: var(--red-dark); border-color: #F3C8C8;
}
.dash-btn.danger:hover { background: #F8DADA; }

/* ---------- License panel (GEOX Pro) ---------- */
.dash-license {
  margin-top: 28px;
  padding: 22px 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.dash-license h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.dash-license .sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.dash-license-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.dash-license-row[hidden] { display: none; }
.dash-license-form { display: flex; gap: 8px; flex: 1; min-width: 260px; flex-wrap: wrap; }
.dash-license-form input {
  flex: 1; min-width: 220px;
  padding: 9px 12px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--white); color: var(--ink);
  font-family: inherit; outline: none;
  letter-spacing: .5px;
}
.dash-license-form input:focus { border-color: var(--red); }
@media (max-width: 640px) {
  .dash-license { padding: 18px 16px; margin-top: 20px; }
  .dash-license-form input { font-size: 16px; }
}

/* ---------- A11y + mobile pass (Sprint 4) ---------- */

/* Visible keyboard-focus ring on every interactive control. The default
   browser outline is washed out by the rounded pills, so force our own. */
.dash-btn:focus-visible,
.dash-brand:focus-visible,
.dash-card a:focus-visible,
.dash-card button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* Make the toast reachable by screen readers. Pair with role="status"
   added to #dash-toast in the HTML so changes are announced politely. */
.dash-toast[role="status"] { /* no-op — just anchors the selector */ }

/* Phones: stack the topbar, drop the desktop right-side row, and let
   the welcome card wrap cleanly. Also bump tap targets to 44px. */
@media (max-width: 640px) {
  .dash-top {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
  }
  .dash-top .spacer { display: none; }
  .dash-account {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .dash-account #dash-email {
    flex-basis: 100%;
    font-weight: 600;
    color: var(--ink);
  }
  .dash-shell { margin: 20px auto 40px; padding: 0 14px; gap: 18px; }
  .dash-welcome { padding: 20px 18px; }
  .dash-welcome h1 { font-size: 20px; }
  .dash-usage { width: 100%; }
  .dash-usage-bar { flex: 1; width: auto; }
  .dash-projects { padding: 18px 16px; }
  .dash-grid { grid-template-columns: 1fr !important; }
  .dash-btn { min-height: 40px; padding: 10px 16px; }
  .dash-btn.primary { width: 100%; text-align: center; }
  .dash-danger { margin-top: 24px; padding: 18px 16px; }
  .dash-danger-row .dash-btn { flex: 1 1 160px; text-align: center; }
}

/* Suspension banner — amber, above the fold. */
.dash-suspended {
  background: #fff6e0;
  border: 1px solid #e7b23b;
  color: #5a3b00;
  border-radius: 14px;
  padding: 14px 18px;
  margin: 18px auto 0;
  max-width: 1200px;
  font-size: 14px;
  line-height: 1.5;
}
.dash-suspended strong { color: #7a4f00; margin-right: 6px; }

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  .dash-btn,
  .dash-btn:hover,
  .dash-usage-fill,
  .dash-toast { transition: none; transform: none; }
}
