/*
 * My Dashboard (_dashboard.php) and the dashboard summary on the signed-in
 * home page (index.php, .rzd-summary). Everything is scoped to .rzd* classes.
 */
:root {
  --rzd-ink: #16212c;
  --rzd-muted: #5f6d7b;
  --rzd-line: #e3e9ef;
  --rzd-bg: #f5f7fa;
  --rzd-card: #fff;
  --rzd-primary: #0091ff;
  --rzd-primary-dark: #0a7fe0;
  --rzd-navy: #03446a;
  --rzd-radius: 16px;
  --rzd-shadow: 0 1px 2px rgba(16, 33, 48, 0.04), 0 8px 24px -12px rgba(16, 33, 48, 0.12);
}

body.rzd-body {
  background: var(--rzd-bg);
}

.rzd {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 56px;
  color: var(--rzd-ink);
}

.rzd h1,
.rzd h2,
.rzd p {
  margin: 0;
  text-align: left;
}

/* ---------- Storefront: banner, avatar and name from the profile ---------- */
.rzd-store {
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--rzd-line);
  border-radius: 20px;
  background: var(--rzd-card);
  box-shadow: var(--rzd-shadow);
}

.rzd-store-cover {
  position: relative;
  height: clamp(220px, 25vw, 320px);
  background:
    radial-gradient(ellipse 60% 120% at 15% 0%, rgba(0, 145, 255, 0.45), transparent 60%),
    radial-gradient(ellipse 50% 100% at 90% 30%, rgba(14, 159, 110, 0.35), transparent 60%),
    linear-gradient(135deg, #0f1b26, #03446a);
}

.rzd-store-cover.has-image { background-position: center; background-size: cover; }

.rzd-store-edit {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(15, 27, 38, 0.62);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background-color 0.15s ease;
}

.rzd-store-edit:hover, .rzd-store-edit:focus-visible { background: rgba(15, 27, 38, 0.85); color: #fff; outline: none; }

.rzd-store-head {
  position: relative;            /* keeps the avatar above the banner it overlaps */
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 4px 18px;
  padding: 12px 22px 18px;
}

.rzd-store-avatar { display: block; margin-top: -56px; border-radius: 50%; line-height: 0; }

.rzd-store-avatar img {
  width: 104px;
  height: 104px;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #eef2f6;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(3, 68, 106, 0.2);
}

.rzd-store-avatar:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 145, 255, 0.35); }
.rzd-store-id { min-width: 0; }

.rzd-store-id h1 {
  font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--rzd-ink);
  overflow-wrap: anywhere;
}

.rzd-store-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 8px !important;
  font-size: 0.92rem;
  color: var(--rzd-muted);
}

.rzd-store-meta a { font-weight: 600; text-decoration: none; color: var(--rzd-primary-dark); }
.rzd-store-meta a:hover { text-decoration: underline; }
.rzd-store-meta i { margin-right: 4px; font-size: 0.85em; }

.rzd-hero h2.rzd-welcome {
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--rzd-ink);
}

@media (max-width: 600px) {
  .rzd-store { border-radius: 16px; }
  .rzd-store-head { grid-template-columns: minmax(0, 1fr); padding: 0 16px 16px; }
  .rzd-store-avatar { width: 88px; margin-top: -46px; }
  .rzd-store-avatar img { width: 88px; height: 88px; border-width: 4px; }
  .rzd-store-edit span { display: none; }
  .rzd-store-edit { padding: 7px 11px; }
}

/* ---------- Greeting ---------- */
.rzd-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 22px;
}

.rzd-eyebrow {
  margin-bottom: 6px !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rzd-primary);
}

.rzd-hero h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--rzd-ink);
}

.rzd-sub {
  margin-top: 6px !important;
  font-size: 1rem;
  color: var(--rzd-muted);
}

.rzd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rzd-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--rzd-line);
  border-radius: 999px;
  background: #fff;
  color: var(--rzd-ink);
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.rzd-btn:hover,
.rzd-btn:focus-visible {
  border-color: #b8d9f5;
  color: var(--rzd-navy);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 145, 255, 0.12);
}

.rzd-btn-primary {
  border-color: var(--rzd-primary);
  background: var(--rzd-primary);
  color: #fff;
}

.rzd-btn-primary:hover,
.rzd-btn-primary:focus-visible {
  border-color: var(--rzd-primary-dark);
  background: var(--rzd-primary-dark);
  color: #fff;
}

.rzd-pill {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ---------- Key figures ---------- */
.rzd-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.rzd-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--rzd-line);
  border-radius: var(--rzd-radius);
  background: var(--rzd-card);
  box-shadow: var(--rzd-shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.rzd-kpi:hover,
a.rzd-kpi:focus-visible {
  border-color: #b8d9f5;
  color: inherit;
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -14px rgba(3, 68, 106, 0.3);
}

.rzd-kpi-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
  border-radius: 10px;
  font-size: 16px;
}

.rzd-tone-green  { background: #e7f8ef; color: #0e9f6e; }
.rzd-tone-blue   { background: #e8f4ff; color: var(--rzd-primary); }
.rzd-tone-amber  { background: #fff4de; color: #d97706; }
.rzd-tone-violet { background: #f1ecff; color: #7c3aed; }
.rzd-tone-sky    { background: #e6f8fb; color: #0891b2; }
.rzd-tone-rose   { background: #fdecf1; color: #e11d48; }

.rzd-kpi-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rzd-muted);
}

.rzd-kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--rzd-ink);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.rzd-kpi-note {
  font-size: 0.8rem;
  color: var(--rzd-muted);
}

/* ---------- Cards ---------- */
.rzd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.rzd-span-2 { grid-column: span 2; }
.rzd-span-3 { grid-column: 1 / -1; }

.rzd-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--rzd-line);
  border-radius: var(--rzd-radius);
  background: var(--rzd-card);
  box-shadow: var(--rzd-shadow);
}

.rzd-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 16px;
}

.rzd-card-head h2 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--rzd-ink);
}

.rzd-card-head p {
  font-size: 0.86rem;
  color: var(--rzd-muted);
}

.rzd-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--rzd-primary);
  text-decoration: none;
}

.rzd-link:hover { color: var(--rzd-primary-dark); text-decoration: underline; }

.rzd-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rzd-line);
  font-size: 0.88rem;
  color: var(--rzd-muted);
}

.rzd-card-foot strong { color: var(--rzd-ink); }
.rzd-card-foot a { margin-left: auto; font-weight: 600; color: var(--rzd-primary); text-decoration: none; }

/* ---------- Earnings bars ---------- */
.rzd-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  height: 200px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rzd-bars li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
  min-width: 0;
}

.rzd-bar {
  width: min(44px, 100%);
  height: var(--h);
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #4db3ff, var(--rzd-primary));
}

.rzd-bars li:last-child .rzd-bar {
  background: linear-gradient(180deg, #0e9f6e, #0b8a5f);
}

.rzd-bar-value {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--rzd-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rzd-bar-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rzd-muted);
}

/* ---------- Empty states ---------- */
.rzd-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 12px;
  border: 1px dashed #d5dee7;
  border-radius: 12px;
  background: #fafcfe;
  text-align: center;
}

.rzd-empty > i {
  font-size: 26px;
  color: #9fb3c6;
}

.rzd-empty p {
  max-width: 420px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--rzd-muted);
  text-align: center;
}

.rzd-empty p strong { color: var(--rzd-ink); }
.rzd-empty-sm { padding: 20px 12px; }

/* ---------- Checklist ---------- */
.rzd-progress {
  height: 6px;
  margin: -6px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef4;
}

.rzd-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rzd-primary), #0e9f6e);
}

.rzd-checklist {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rzd-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 0.93rem;
}

.rzd-checklist li i { width: 18px; color: #b3c2d0; text-align: center; }
.rzd-checklist li a { font-weight: 600; color: var(--rzd-ink); text-decoration: none; }
.rzd-checklist li:not(.is-done):hover { background: #f2f8fe; }
.rzd-checklist li:not(.is-done):hover a { color: var(--rzd-primary); }
.rzd-checklist li.is-done { color: var(--rzd-muted); }
.rzd-checklist li.is-done span { text-decoration: line-through; }
.rzd-checklist li.is-done i { color: #0e9f6e; }

/* ---------- Stats list (renting) ---------- */
.rzd-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.rzd-stats div {
  padding: 12px;
  border-radius: 12px;
  background: #f6f9fc;
}

.rzd-stats dt { font-size: 0.8rem; font-weight: 600; color: var(--rzd-muted); }
.rzd-stats dd { margin: 2px 0 0; font-size: 1.3rem; font-weight: 800; color: var(--rzd-ink); font-variant-numeric: tabular-nums; }

/* ---------- Listings ---------- */
.rzd-listings {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rzd-listing {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 8px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.rzd-listing:hover,
.rzd-listing:focus-visible {
  background: #f2f8fe;
  color: inherit;
  outline: none;
}

.rzd-listing img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #eef2f6;
  object-fit: cover;
}

.rzd-listing-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rzd-listing-title {
  display: block;
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--rzd-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rzd-listing-meta {
  display: block;
  font-size: 0.82rem;
  color: var(--rzd-muted);
}

.rzd-listing-stat {
  font-size: 0.85rem;
  color: var(--rzd-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Badges ---------- */
.rzd-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.rzd-badge-ok    { background: #e7f8ef; color: #046c4e; }
.rzd-badge-warn  { background: #fff4de; color: #8a4b08; }
.rzd-badge-bad   { background: #fdecec; color: #9b1c1c; }
.rzd-badge-info  { background: #e8f4ff; color: var(--rzd-navy); }
.rzd-badge-muted { background: #eef2f6; color: #4b5866; }

/* ---------- Timeline ---------- */
.rzd-timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rzd-timeline li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.rzd-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  border-radius: 10px;
  background: #e8f4ff;
  color: var(--rzd-primary);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}

.rzd-date strong { font-size: 1.15rem; color: var(--rzd-navy); }

/* ---------- Activity table ---------- */
.rzd-table-wrap { overflow-x: auto; }

.rzd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.rzd-table th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--rzd-line);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  color: var(--rzd-muted);
}

.rzd-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #eff3f7;
  vertical-align: middle;
}

.rzd-table tr:last-child td { border-bottom: 0; }
.rzd-table td a { font-weight: 600; color: var(--rzd-ink); text-decoration: none; }
.rzd-table td a:hover { color: var(--rzd-primary); }
.rzd-role { display: block; font-size: 0.78rem; color: var(--rzd-muted); }
.rzd-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rzd-in { color: #046c4e; font-weight: 700; }

/* ---------- Home page summary (index.php, signed in) ---------- */
.rzd-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr);
  align-items: center;
  gap: 16px 24px;
  margin: 20px 0 8px;
  padding: 18px 20px;
  border: 1px solid var(--rzd-line);
  border-radius: var(--rzd-radius);
  background: linear-gradient(135deg, #ffffff 0%, #f2f8ff 100%);
  box-shadow: var(--rzd-shadow);
  color: var(--rzd-ink);
  text-align: left;
}

.rzd-summary h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 800;
  text-align: left;
  color: var(--rzd-ink);
}

.rzd-summary p {
  margin: 0 0 12px;
  font-size: 0.92rem;
  text-align: left;
  color: var(--rzd-muted);
}

.rzd-summary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.rzd-summary-stats a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--rzd-line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.rzd-summary-stats a:hover { border-color: #b8d9f5; transform: translateY(-1px); color: inherit; }
.rzd-summary-stats strong { font-size: 1.4rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rzd-summary-stats span { font-size: 0.78rem; font-weight: 600; color: var(--rzd-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .rzd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .rzd-grid { grid-template-columns: minmax(0, 1fr); }
  .rzd-span-2, .rzd-span-3 { grid-column: auto; }
  .rzd-summary { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .rzd { padding: 20px 16px 40px; }
  .rzd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rzd-kpi { padding: 14px; }
  .rzd-kpi-value { font-size: 1.35rem; }
  .rzd-actions { width: 100%; }
  .rzd-actions .rzd-btn { flex: 1 1 auto; justify-content: center; }
  .rzd-listing { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; }
  .rzd-listing img { width: 48px; height: 48px; }
  .rzd-listing .rzd-listing-stat { display: none; }
  .rzd-bars { gap: 6px; height: 170px; }
  .rzd-bar-value { font-size: 0.66rem; }
  .rzd-summary-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rzd-table th:nth-child(2), .rzd-table td:nth-child(2) { display: none; }
}

/* ---------- Browse header (index.php, signed in) ---------- */
.rzd-browse-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 24px 0 8px;
  color: var(--rzd-ink);
  text-align: left;
}

.rzd-browse-head h1 {
  margin: 0;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: left;
  color: var(--rzd-ink);
}

.rzd-browse-head p {
  margin: 4px 0 0;
  font-size: 0.95rem;
  text-align: left;
  color: var(--rzd-muted);
}

.rzd-browse-head .rzd-eyebrow {
  margin: 0 0 4px;
}
