/* ==========================================================================
   Account Dashboard — unique page-specific components.
   Design blueprint: the order list becomes an Elementor Loop Grid querying
   real service_order posts — this defines the exact card template it needs.
   ========================================================================== */
body.app-body { overflow-x: hidden; }
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
@media (max-width: 900px) { .app-shell { grid-template-columns: 1fr; } }

/* ---- Sidebar ---- */
.app-sidebar { background: var(--bg-alt); border-right: 1px solid var(--border); padding: 1.75rem 1.25rem; display: flex; flex-direction: column; }
@media (max-width: 900px) { .app-sidebar { border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; } }
.app-sidebar__brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 2.5rem; }
.app-sidebar__brand img { height: 28px; width: 28px; }
.app-sidebar__brand span { font-weight: 700; color: var(--white); }
@media (max-width: 900px) { .app-sidebar__brand { margin-bottom: 0; } }
.app-nav { display: flex; flex-direction: column; gap: 0.3rem; flex-grow: 1; }
@media (max-width: 900px) { .app-nav { display: none; } }
.app-nav a { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.8rem; border-radius: var(--radius-sm); color: var(--muted); font-size: 0.92rem; }
.app-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.app-nav a:hover { color: var(--white); text-decoration: none; background: rgba(255,255,255,0.03); }
.app-nav a.is-active { color: var(--white); background: rgba(250,184,44,0.08); }
.app-sidebar__logout { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.8rem; color: var(--muted); font-size: 0.92rem; margin-top: auto; }
.app-sidebar__logout svg { width: 18px; height: 18px; }
.app-sidebar__logout:hover { color: var(--white); text-decoration: none; }
@media (max-width: 900px) { .app-sidebar__logout { margin-top: 0; } }

/* ---- Main content ---- */
.app-main { padding: clamp(1.75rem, 4vw, 3rem); }
.app-main__head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; }
.app-main__head h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.app-main__head p { color: var(--muted); margin-top: 0.4rem; }

/* ---- Quick stats ---- */
.app-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
.app-stat { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.4rem; background: var(--surface); }
.app-stat strong { display: block; font-size: 1.8rem; font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; }
.app-stat span { display: block; margin-top: 0.3rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
@media (max-width: 700px) { .app-stats { grid-template-columns: 1fr; } }

/* ---- Order cards with stage-progress tracker ---- */
.order-list { display: flex; flex-direction: column; gap: 1.1rem; }
.order-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-solid); padding: 1.5rem 1.75rem; }
.order-card__head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.order-card__name { font-size: 1.05rem; font-weight: 700; color: var(--white); }
.order-card__ref { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
.order-card__link { font-family: var(--font-mono); font-size: 0.8rem; color: var(--orange); flex-shrink: 0; }

.stage-tracker { display: flex; align-items: center; }
.stage-tracker__step { flex: 1; position: relative; }
.stage-tracker__dot { width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center; margin-inline: auto; position: relative; z-index: 1; }
.stage-tracker__dot svg { width: 10px; height: 10px; color: var(--bg); opacity: 0; transition: opacity 0.2s ease; }
.stage-tracker__step.is-complete .stage-tracker__dot { background: var(--success); border-color: var(--success); }
.stage-tracker__step.is-complete .stage-tracker__dot svg { opacity: 1; }
.stage-tracker__step.is-current .stage-tracker__dot { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 4px rgba(250,184,44,0.18); animation: stagePulse 1.8s ease-in-out infinite; }
@keyframes stagePulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(250,184,44,0.18); } 50% { box-shadow: 0 0 0 8px rgba(250,184,44,0.08); } }
@media (prefers-reduced-motion: reduce) { .stage-tracker__step.is-current .stage-tracker__dot { animation: none; } }
.stage-tracker__line { position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--border-strong); z-index: 0; }
.stage-tracker__step:first-child .stage-tracker__line { display: none; }
.stage-tracker__step.is-complete .stage-tracker__line { background: var(--success); }
.stage-tracker__label { display: block; text-align: center; font-family: var(--font-mono); font-size: 0.66rem; color: var(--muted); margin-top: 0.6rem; text-transform: uppercase; letter-spacing: 0.03em; }
.stage-tracker__step.is-current .stage-tracker__label { color: var(--orange); }
.stage-tracker__step.is-complete .stage-tracker__label { color: var(--text); }
@media (max-width: 620px) { .stage-tracker__label { display: none; } }
