/**
 * RD Console v2 — Indigo Micro-SaaS Bento Dashboard
 * Design: ui-ux-pro-max + baoyu-design hi-fi
 */
:root {
  --color-primary: #6366f1;
  --color-primary-dark: #4f46e5;
  --color-primary-soft: #eef2ff;
  --color-secondary: #818cf8;
  --color-cta: #10b981;
  --color-cta-hover: #059669;
  --color-background: #f5f3ff;
  --color-surface: #ffffff;
  --color-surface-glass: rgba(255, 255, 255, 0.78);
  --color-text: #1e1b4b;
  --color-muted: #64748b;
  --color-border: rgba(99, 102, 241, 0.12);
  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --shadow-sm: 0 1px 2px rgba(30, 27, 75, 0.06);
  --shadow-md: 0 8px 24px rgba(99, 102, 241, 0.1);
  --shadow-lg: 0 18px 40px rgba(99, 102, 241, 0.14);
  --shadow-card: 0 4px 20px rgba(30, 27, 75, 0.06);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --sidebar-width: 272px;
  --topbar-height: 68px;
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --tone-indigo: #6366f1;
  --tone-violet: #8b5cf6;
  --tone-emerald: #10b981;
  --tone-sky: #0ea5e9;
  --tone-amber: #f59e0b;
  --tone-rose: #f43f5e;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.rdc-body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.rdc-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Ambient background */
.rdc-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.rdc-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

.rdc-bg__orb--1 {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: #c7d2fe;
}

.rdc-bg__orb--2 {
  width: 360px;
  height: 360px;
  bottom: -100px;
  left: -60px;
  background: #ddd6fe;
}

.rdc-bg__orb--3 {
  width: 240px;
  height: 240px;
  top: 40%;
  left: 45%;
  background: #a7f3d0;
  opacity: 0.35;
}

.rdc-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

/* Layout */
.rdc-app {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}

.rdc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.rdc-content {
  flex: 1;
  padding: var(--space-lg);
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* Sidebar */
.rdc-sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface-glass);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 40;
  box-shadow: 4px 0 24px rgba(99, 102, 241, 0.04);
}

.rdc-sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.rdc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.rdc-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.rdc-brand__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rdc-brand__name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rdc-brand__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.rdc-sidebar__close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-primary-soft);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.rdc-sidebar__close:hover {
  background: #e0e7ff;
}

.rdc-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-lg);
}

.rdc-nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 10px 10px;
}

.rdc-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rdc-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: #4338ca;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.rdc-nav-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--color-primary);
}

.rdc-nav-link:hover {
  background: rgba(99, 102, 241, 0.08);
}

.rdc-nav-item.is-active .rdc-nav-link {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(129, 140, 248, 0.1));
  color: var(--color-primary-dark);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.rdc-nav-item.is-active .rdc-nav-link__icon {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
}

.rdc-sidebar__user {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.rdc-user-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding: 10px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(16, 185, 129, 0.05));
  border: 1px solid var(--color-border);
}

.rdc-user-card__avatar,
.rdc-topbar__avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.28);
}

.rdc-user-card__name {
  font-weight: 700;
  font-size: 14px;
}

.rdc-user-card__role {
  font-size: 12px;
  color: var(--color-muted);
}

.rdc-sidebar__actions {
  display: flex;
  gap: var(--space-sm);
}

.rdc-sidebar__backdrop {
  display: none;
}

/* Topbar */
.rdc-topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0 var(--space-lg);
  background: var(--color-surface-glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.rdc-topbar__menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-primary);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.rdc-topbar__menu:hover {
  background: var(--color-primary-soft);
  box-shadow: var(--shadow-sm);
}

.rdc-topbar__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.rdc-topbar__crumb {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 600;
}

.rdc-topbar__sep {
  color: #c7d2fe;
}

.rdc-topbar__page {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rdc-topbar__actions {
  display: none;
}

.rdc-topbar__user {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.rdc-topbar__user:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: var(--shadow-sm);
}

.rdc-topbar__username {
  font-size: 13px;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Buttons */
.rdc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.rdc-btn--primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.28);
}

.rdc-btn--primary:hover {
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.36);
  opacity: 0.96;
}

.rdc-btn--soft {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  border-color: rgba(99, 102, 241, 0.12);
}

.rdc-btn--soft:hover {
  background: #e0e7ff;
}

.rdc-btn--ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-muted);
}

.rdc-btn--ghost:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

.rdc-btn--danger:hover {
  background: var(--color-danger-bg);
  border-color: #fecaca;
  color: var(--color-danger);
}

.rdc-btn--sm {
  padding: 8px 14px;
  font-size: 13px;
}

.rdc-btn--block {
  width: 100%;
}

.rdc-btn:focus-visible,
.rdc-nav-link:focus-visible,
.rdc-bento-card:focus-visible,
.rdc-quick-card:focus-visible,
.rdc-list-item:focus-visible,
.rdc-topbar__menu:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Hero */
.rdc-hero {
  position: relative;
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.14);
  background: linear-gradient(135deg, #ffffff 0%, #f8f7ff 45%, #f0fdf4 100%);
  box-shadow: var(--shadow-lg);
}

.rdc-hero__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(129, 140, 248, 0.22), transparent 42%),
    radial-gradient(circle at 10% 80%, rgba(16, 185, 129, 0.14), transparent 40%);
  pointer-events: none;
}

.rdc-hero__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.rdc-hero__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--space-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
}

.rdc-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(16, 185, 129, 0.1));
  color: var(--color-primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.rdc-hero__title {
  margin: 0 0 var(--space-sm);
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.rdc-hero__desc {
  margin: 0;
  color: var(--color-muted);
  max-width: 52ch;
  font-size: 15px;
}

.rdc-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.rdc-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--color-border);
  min-width: 160px;
  backdrop-filter: blur(8px);
}

.rdc-stat--primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(129, 140, 248, 0.08));
  border-color: rgba(99, 102, 241, 0.18);
}

.rdc-stat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
}

.rdc-stat__value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text);
}

.rdc-stat__label {
  margin-top: 2px;
  font-size: 12px;
  color: var(--color-muted);
  font-weight: 600;
}

/* Sections */
.rdc-section {
  margin-bottom: var(--space-xl);
}

.rdc-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.rdc-section__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.rdc-section__sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--color-muted);
}

.rdc-section__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.25);
}

/* Quick actions */
.rdc-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.rdc-quick-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.rdc-quick-card:hover {
  border-color: rgba(99, 102, 241, 0.22);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.rdc-quick-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  flex-shrink: 0;
}

.rdc-quick-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.rdc-quick-card__body strong {
  font-size: 14px;
  font-weight: 700;
}

.rdc-quick-card__body small {
  font-size: 12px;
  color: var(--color-muted);
}

.rdc-quick-card__arrow {
  color: var(--color-muted);
  opacity: 0.5;
  transition: opacity var(--transition), transform var(--transition);
}

.rdc-quick-card:hover .rdc-quick-card__arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* Tone utilities */
.rdc-tone-indigo .rdc-quick-card__icon,
.rdc-tone-indigo .rdc-bento-card__icon,
.rdc-tone-indigo.rdc-empty__icon {
  background: rgba(99, 102, 241, 0.12);
  color: var(--tone-indigo);
}

.rdc-tone-violet .rdc-quick-card__icon,
.rdc-tone-violet .rdc-bento-card__icon,
.rdc-tone-violet.rdc-empty__icon {
  background: rgba(139, 92, 246, 0.12);
  color: var(--tone-violet);
}

.rdc-tone-emerald .rdc-quick-card__icon,
.rdc-tone-emerald .rdc-bento-card__icon,
.rdc-tone-emerald.rdc-empty__icon {
  background: rgba(16, 185, 129, 0.12);
  color: var(--tone-emerald);
}

.rdc-tone-sky .rdc-quick-card__icon,
.rdc-tone-sky .rdc-bento-card__icon {
  background: rgba(14, 165, 233, 0.12);
  color: var(--tone-sky);
}

.rdc-tone-amber .rdc-quick-card__icon,
.rdc-tone-amber .rdc-bento-card__icon {
  background: rgba(245, 158, 11, 0.14);
  color: var(--tone-amber);
}

.rdc-tone-rose .rdc-quick-card__icon,
.rdc-tone-rose .rdc-bento-card__icon {
  background: rgba(244, 63, 94, 0.12);
  color: var(--tone-rose);
}

/* Bento service grid */
.rdc-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.rdc-bento-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.rdc-bento-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--tone-color, var(--color-primary)), transparent);
  opacity: 0.85;
}

.rdc-bento-card.rdc-tone-indigo { --tone-color: var(--tone-indigo); }
.rdc-bento-card.rdc-tone-violet { --tone-color: var(--tone-violet); }
.rdc-bento-card.rdc-tone-emerald { --tone-color: var(--tone-emerald); }
.rdc-bento-card.rdc-tone-sky { --tone-color: var(--tone-sky); }
.rdc-bento-card.rdc-tone-amber { --tone-color: var(--tone-amber); }
.rdc-bento-card.rdc-tone-rose { --tone-color: var(--tone-rose); }

.rdc-bento-card:hover {
  border-color: rgba(99, 102, 241, 0.22);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.rdc-bento-card--featured {
  grid-column: span 2;
  min-height: 210px;
  background: linear-gradient(145deg, #ffffff 0%, #f5f3ff 100%);
}

.rdc-bento-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.rdc-bento-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.rdc-bento-card__icon .rdc-icon {
  width: 1.4rem;
  height: 1.4rem;
}

.rdc-bento-card__ver {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-muted);
  background: var(--color-primary-soft);
  border-radius: 999px;
  padding: 4px 10px;
}

.rdc-bento-card__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.rdc-bento-card__desc {
  margin: 0 0 auto;
  padding-bottom: 16px;
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rdc-bento-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
}

.rdc-bento-card__cta .rdc-icon {
  width: 1rem;
  height: 1rem;
}

/* Panels & empty */
.rdc-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
}

.rdc-panel--center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.rdc-empty {
  text-align: center;
  max-width: 420px;
}

.rdc-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  margin-bottom: var(--space-md);
}

.rdc-empty__icon .rdc-icon {
  width: 2rem;
  height: 2rem;
}

.rdc-empty__code {
  font-size: 4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #c7d2fe, #a7f3d0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.rdc-empty h2 {
  margin: 0 0 var(--space-sm);
  font-size: 1.35rem;
  font-weight: 800;
}

.rdc-empty p {
  margin: 0 0 var(--space-lg);
  color: var(--color-muted);
}

/* Reveal animation */
.rdc-reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rdc-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.rdc-reveal:nth-child(2) { animation-delay: 0.08s; }
.rdc-reveal:nth-child(3) { animation-delay: 0.14s; }

.rdc-bento-card {
  opacity: 0;
  animation: rdc-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.06s * var(--reveal-i, 0));
}

@keyframes rdc-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* List / article (inner pages) */
.rdc-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.rdc-list-item {
  display: block;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.rdc-list-item:hover {
  border-color: rgba(99, 102, 241, 0.22);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.rdc-list-item__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.rdc-list-item__excerpt {
  margin: 0 0 8px;
  color: var(--color-muted);
  font-size: 13px;
}

.rdc-list-item__meta {
  display: flex;
  gap: var(--space-md);
  font-size: 12px;
  color: var(--color-muted);
}

.rdc-list-item__badge {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
}

.rdc-article {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
}

.rdc-article__title {
  margin: 0 0 var(--space-sm);
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 800;
}

.rdc-article__meta {
  display: flex;
  gap: var(--space-md);
  color: var(--color-muted);
  font-size: 13px;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.rdc-article__body {
  line-height: 1.8;
}

.rdc-comment {
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
  background: rgba(255, 255, 255, 0.7);
}

.rdc-comment__head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: 13px;
  margin-bottom: 6px;
}

.rdc-pagebar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-lg);
}

.rdc-pagebar__link,
.rdc-pagebar__now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.rdc-pagebar__link {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  transition: background var(--transition);
}

.rdc-pagebar__link:hover {
  background: var(--color-primary-soft);
}

.rdc-pagebar__now {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  font-weight: 700;
}

.rdc-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.rdc-input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Responsive */
@media (max-width: 1023px) {
  .rdc-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
  }

  .rdc-sidebar.is-open {
    transform: translateX(0);
  }

  .rdc-sidebar__close {
    display: inline-flex;
  }

  .rdc-sidebar__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.42);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
  }

  .rdc-sidebar__backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .rdc-topbar__menu {
    display: inline-flex;
  }

  .rdc-topbar__username {
    display: none;
  }

  .rdc-content {
    padding: var(--space-md);
  }

  .rdc-bento {
    grid-template-columns: 1fr;
  }

  .rdc-bento-card--featured {
    grid-column: span 1;
  }

  .rdc-quick-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .rdc-hero__stats {
    width: 100%;
  }

  .rdc-stat {
    flex: 1;
    min-width: 0;
  }

  .rdc-sidebar__actions {
    flex-direction: column;
  }

  .rdc-sidebar__actions .rdc-btn {
    width: 100%;
  }

  .rdc-quick-card__arrow {
    display: none;
  }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .rdc-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rdc-bento-card--featured {
    grid-column: span 2;
  }
}

@media (min-width: 1440px) {
  .rdc-content {
    padding: var(--space-xl) var(--space-2xl);
  }
}

/* Main nav from navbar module */
.rdc-nav-list--main {
  margin: 0;
  padding: 0;
}

.rdc-nav-list--main > .rdc-nav-item {
  list-style: none;
  margin: 0;
}

.rdc-nav-list--main .rdc-nav-link {
  width: 100%;
}

.rdc-nav-sub {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0 0 0 46px;
}

.rdc-nav-sub__item a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-muted);
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}

.rdc-nav-sub__item a:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--color-text);
}

.rdc-user-card {
  cursor: pointer;
  transition: box-shadow var(--transition);
}

a.rdc-user-card:hover {
  box-shadow: var(--shadow-sm);
}

.rdc-hero--compact .rdc-hero__inner {
  padding: var(--space-lg) clamp(1.25rem, 2.5vw, 1.75rem);
}

.rdc-hero--compact .rdc-hero__title {
  font-size: clamp(1.45rem, 2.8vw, 1.9rem);
}

.rdc-section--workbench {
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 247, 255, 0.88));
  box-shadow: var(--shadow-card);
}

.rdc-section--workbench .rdc-quick-grid {
  margin-bottom: var(--space-lg);
}

.rdc-bento--compact {
  margin-top: 0;
}

.rdc-bento--compact .rdc-bento-card--featured {
  grid-column: span 1;
}

/* Search */
.rdc-search {
  display: flex;
  align-items: stretch;
  flex: 1;
  max-width: 420px;
  margin-left: auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.rdc-search:focus-within {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.rdc-search__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--color-muted);
  background: rgba(99, 102, 241, 0.04);
}

.rdc-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text);
  padding: 10px 8px;
  outline: none;
}

.rdc-search__input::placeholder {
  color: #94a3b8;
}

.rdc-search__submit {
  border: none;
  border-left: 1px solid var(--color-border);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0 16px;
  cursor: pointer;
  transition: opacity var(--transition);
  white-space: nowrap;
}

.rdc-search__submit:hover {
  opacity: 0.92;
}

/* Post grid & cards */
.rdc-post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.rdc-post-card {
  min-height: 100%;
}

.rdc-post-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.rdc-post-card__link:hover {
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.rdc-post-card--top .rdc-post-card__link {
  background: linear-gradient(145deg, #ffffff, #f5f3ff);
  border-color: rgba(99, 102, 241, 0.2);
}

.rdc-post-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.rdc-post-card__cate {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  font-size: 11px;
  font-weight: 700;
}

.rdc-post-card__badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
}

.rdc-post-card__date {
  font-size: 12px;
  color: var(--color-muted);
  font-weight: 600;
}

.rdc-post-card__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rdc-post-card__excerpt {
  margin: 0 0 14px;
  flex: 1;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rdc-post-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-muted);
}

.rdc-post-card__author {
  font-weight: 700;
  color: var(--color-text);
}

.rdc-post-card__meta {
  display: inline-flex;
  gap: 10px;
}

.rdc-post-card__more {
  margin-left: auto;
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0;
  transition: opacity var(--transition);
}

.rdc-post-card__link:hover .rdc-post-card__more {
  opacity: 1;
}

@media (max-width: 1023px) {
  .rdc-topbar {
    height: auto;
    min-height: var(--topbar-height);
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .rdc-post-grid {
    grid-template-columns: 1fr;
  }

  .rdc-search {
    max-width: none;
    order: 3;
    width: 100%;
    margin: 0;
  }

  .rdc-topbar {
    flex-wrap: wrap;
  }

  .rdc-topbar__title {
    order: 2;
    flex: 1;
  }

  .rdc-topbar__menu {
    order: 1;
  }
}

@media (max-width: 767px) {
  .rdc-search__submit {
    padding: 0 12px;
    font-size: 12px;
  }

  .rdc-post-card__more {
    opacity: 1;
  }
}

.rdc-post-card--search .rdc-post-card__link {
  min-height: 120px;
}

.rdc-post-card--search .rdc-post-card__excerpt {
  margin-bottom: 0;
}

/* Legacy cleanup - hide old list/page layout */
.rdc-page,
.rdc-page__aside,
.rdc-guest-banner,
.rdc-topbar__search {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Widgets */
.rdc-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.rdc-widget__title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.rdc-widget-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rdc-widget-list li a {
  display: block;
  padding: 6px 0;
  color: var(--color-muted);
  font-size: 13px;
  cursor: pointer;
  transition: color var(--transition);
}

.rdc-widget-list li a:hover {
  color: var(--color-primary);
}

/* List item enhancements */
.rdc-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.rdc-list-item__more {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0;
  transition: opacity var(--transition);
}

.rdc-list-item:hover .rdc-list-item__more {
  opacity: 1;
}

/* Article extras */
.rdc-article__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.rdc-article__tags-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-muted);
}

.rdc-tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.rdc-tag:hover {
  background: #e0e7ff;
}

.rdc-article__nav {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-muted);
}

.rdc-article__nav a {
  color: var(--color-primary);
  font-weight: 600;
}

.rdc-article__nav-prev,
.rdc-article__nav-next {
  margin: 0 0 8px;
}

/* Comments */
.rdc-comments {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.rdc-comments__title {
  margin: 0 0 var(--space-md);
  font-size: 1rem;
  font-weight: 800;
}

.rdc-comment__actions {
  margin-top: 8px;
}

.rdc-comment__reply {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  cursor: pointer;
}

.rdc-comment-form {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.85);
}

.rdc-comment-form__title {
  margin: 0 0 var(--space-md);
  font-size: 1rem;
  font-weight: 800;
}

.rdc-comment-form__cancel {
  display: inline-block;
  margin-bottom: var(--space-sm);
  font-size: 13px;
  color: var(--color-muted);
}

.rdc-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.rdc-form-group {
  margin-bottom: var(--space-md);
}

.rdc-form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}

.rdc-captcha {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.rdc-captcha img {
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}


@media (max-width: 1023px) {
  .rdc-form-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .rdc-reveal,
  .rdc-bento-card {
    opacity: 1;
    transform: none;
  }
}
