/* ==========================================================================
   Account area — shared by dashboard, dash-articles, dash-articles-edit,
   dash-settings and dash-profile.
   Index: page track · profile card · tab bar · panel · list head · list item
          · meta row · sub-card · form details · confirm row · live status
          · wide screens · field skin
   Status pills are .badge--sm + .badge--success / --pending / --muted; compact buttons are
   .btn--sm + .btn--line / --danger / --navy / --success (components.css).
   Mobile-first; rows open up at 48rem (768px) and 60rem (960px).
   ========================================================================== */

/* ---- Page track: one 960px column --------------------------------------- */
.dash {
  padding-block: var(--sp-8) var(--sp-12);
}
.dash__inner {
  --container: 60rem;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

/* ---- Profile summary card ---------------------------------------------- */
.dash-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--burgundy-soft);
  border-radius: var(--r-24);
  box-shadow: var(--sh-soft);
}
/* avatar: photo inside a soft burgundy → amber ring, with a white and a rose halo */
.dash-profile__avatar {
  position: relative;
  flex: none;
  width: 6rem;
  height: 6rem;
  padding: var(--sp-1);
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--burgundy) 20%, transparent),
    color-mix(in srgb, var(--amber) 30%, transparent)
  );
  box-shadow:
    0 0 0 4px var(--surface),
    0 0 0 6px color-mix(in srgb, var(--burgundy) 20%, transparent),
    var(--sh-sm);
}
.dash-profile__photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.dash-profile__online {
  position: absolute;
  inset-block-end: var(--sp-1);
  inset-inline-end: var(--sp-1);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--surface);
}
.dash-profile__body {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  min-width: 0;
}
.dash-profile__headline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2) .625rem;
}
.dash-profile__title {
  font-size: clamp(1.375rem, 1.2rem + .8vw, 1.625rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--navy);
}
.dash-profile__badge { padding-inline: var(--sp-3); }
.dash-profile__email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-size: var(--fs-14);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}
.dash-profile__email .icon {
  font-size: .875rem;
  color: var(--text-muted);
}
.dash-profile__edit {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-bd: var(--line-rose-strong);
  padding-inline: var(--sp-5);
  border-radius: var(--r-16);
  box-shadow: var(--sh-xs);
}
.dash-profile__edit .icon {
  font-size: .875rem;
  color: var(--burgundy);
}

/* ---- Tab bar: four links between the account pages ---------------------
   Phones: a 2 × 2 grid (every tab stays visible, no hidden scrolling). */
.dash-tabs {
  padding: .375rem;
  background: color-mix(in srgb, var(--sand) 80%, transparent);
  border: 1px solid var(--line-rose);
  border-radius: var(--r-16);
  box-shadow: var(--sh-xs);
}
.dash-tabs__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
}
.dash-tabs__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 2.75rem;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-14);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  text-align: center;
  border-radius: var(--r-12);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.dash-tabs__link .icon { font-size: 1.0625rem; }
.dash-tabs__link:focus-visible { border-radius: var(--r-12); }
@media (hover: hover) {
  .dash-tabs__link:hover {
    background: var(--sand);
    color: var(--ink);
  }
}
.dash-tabs__link[aria-current="page"] {
  color: var(--text-on-dark);
  background: var(--burgundy);
  box-shadow: var(--sh-xs);
}
.dash-tabs__count {
  display: grid;
  place-items: center;
  flex: none;
  min-width: 1.25rem;
  height: 1.25rem;
  padding-inline: .25rem;
  border-radius: var(--r-full);
  font-size: var(--fs-12);
  line-height: 1;
  color: var(--text);
  background: var(--sand-deep);
}
.dash-tabs__link[aria-current="page"] .dash-tabs__count {
  color: var(--text-on-dark);
  background: var(--on-dark-20);
}
.dash-tabs__dot {
  flex: none;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--amber);
}

/* ---- Panel: the white card that holds a tab's content ------------------ */
.dash-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line-rose);
  border-radius: var(--r-24);
  box-shadow: var(--sh-soft);
}
/* on top of .section-head--split */
.dash-panel__head {
  align-items: center;
  gap: var(--sp-3);
  padding-block-end: var(--sp-4);
  border-block-end: 1px solid var(--line);
}
.dash-panel__title {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: clamp(1.125rem, 1rem + .5vw, 1.25rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}
.dash-panel__title .icon-tile {
  width: 2rem;
  height: 2rem;
}

/* ---- List head: title + counter (+ action) above a list of cards ------- */
.dash-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.dash-list__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-inline: var(--sp-1);
}
.dash-list__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) .625rem;
  font-size: var(--fs-20);
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}
.dash-list__title .icon-tile {
  width: 2rem;
  height: 2rem;
}
.dash-list__count {
  padding: .125rem .625rem;
  border-radius: var(--r-full);
  font-size: var(--fs-12);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  background: var(--sand-strong);
}
.dash-list__items {
  display: flex;
  flex-direction: column;
  gap: .875rem;
}
.dash-list__empty {
  padding: var(--sp-6);
  text-align: center;
  font-size: var(--fs-14);
  color: var(--text-muted);
  border: 1.5px dashed var(--line-rose-strong);
  border-radius: var(--r-16);
}

/* ---- List item: icon tile + text + actions (also carries .card--lift) --- */
.dash-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line-rose);
  border-radius: var(--r-16);
  box-shadow: var(--sh-soft);
}
.dash-item__main {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  min-width: 0;
}
.dash-item__icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--r-16);
  border: 1px solid color-mix(in srgb, var(--burgundy) 20%, transparent);
  box-shadow: var(--sh-xs);
}
.dash-item__icon--amber {
  color: var(--amber-ink);
  background: var(--amber-soft);
  border-color: var(--amber-line);
}
.dash-item__icon--navy {
  color: var(--navy);
  background: var(--navy-tint);
  border-color: var(--line-cool);
}
.dash-item__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}
.dash-item__title {
  font-size: var(--fs-16);
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  text-wrap: pretty;
}
/* phones: the status badge takes its own line, the actions share the rows below it */
.dash-item__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) .625rem;
}
.dash-item__actions > .badge {
  flex: 1 0 100%;
  justify-content: center;
}
.dash-item__actions > a,
.dash-item__actions > button {
  flex: 1 1 8rem;
}
.dash-item__actions > .btn--icon-only { flex: none; }
.dash-accent .icon { color: var(--burgundy); }
@media (min-width: 40.0625rem) {
  .dash-item__actions > .badge {
    flex: initial;
    justify-content: flex-start;
  }
  .dash-item__actions > a,
  .dash-item__actions > button {
    flex: initial;
  }
}
@media (min-width: 60rem) {
  .dash-item {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-5);
  }
  .dash-item__main {
    flex: 1 1 20rem;
    gap: var(--sp-4);
  }
  .dash-item__actions { flex: none; }
}

/* ---- Meta row: small facts separated by dots ---------------------------- */
.dash-meta {
  min-height: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--text);
}
.dash-meta__item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}
.dash-meta__item .icon {
  font-size: .75rem;
  color: var(--text-muted);
}
.dash-meta__item + .dash-meta__item::before {
  content: "•";
  margin-inline-end: var(--sp-1);
  color: var(--line-rose-strong);
}
.dash-meta__item--plain + .dash-meta__item::before { content: none; }
@media (min-width: 48rem) {
  .dash-meta { font-size: var(--fs-12); }
}

/* ---- Sub-card: a tinted box inside a panel (security, quick edit) ------- */
.dash-subcard {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--tint-warm);
  border: 1px solid var(--line);
  border-radius: var(--r-16);
}
.dash-subcard__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-block-end: var(--sp-2);
  border-block-end: 1px solid var(--line);
}
.dash-subcard__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-14);
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
}
.dash-subcard__title .icon { color: var(--burgundy); }
.dash-subcard__note {
  font-size: var(--fs-12);
  color: var(--text-muted);
}
.dash-subcard .input { background-color: var(--surface); }
.dash-subcard__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .625rem;
}
@media (min-width: 40rem) {
  .dash-subcard { padding: var(--sp-5); }
}

/* ---- Form details -------------------------------------------------------- */
.dash-form {
  display: grid;
  gap: var(--sp-5);
}
.dash-form .field { gap: var(--sp-2); }
.dash-form__label {
  justify-content: flex-start;
  align-items: center;
  gap: .375rem;
  font-size: var(--fs-12);
}
.dash-form__label .icon {
  font-size: .8125rem;
  color: var(--burgundy);
}
/* grows with its text where supported */
.dash-form textarea.input {
  min-height: 5rem;
  field-sizing: content;
}
.dash-form .input[readonly] {
  color: var(--text);
  background-color: var(--sand-strong);
  cursor: default;
}
@media (min-width: 40rem) {
  .dash-form--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-form__wide { grid-column: 1 / -1; }
}

/* ---- Confirm row: "are you sure?" inside a list item --------------------- */
.dash-confirm {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--burgundy-deep);
  background: var(--tint-warm);
  border: 1px solid var(--line-rose-strong);
  border-radius: var(--r-12);
}
.dash-confirm__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ---- Live status line (announcements after an action) -------------------- */
.dash-status { align-items: center; }
.dash-status .icon { font-size: 1rem; }

/* ---- ≥ 768px: profile card in one row, four tabs in one row -------------- */
@media (min-width: 48rem) {
  .dash { padding-block: var(--sp-20) var(--sp-16); }
  .dash__inner { gap: var(--sp-8); }
  .dash-profile {
    flex-direction: row;
    gap: var(--sp-5);
    padding: var(--sp-8);
    text-align: start;
  }
  .dash-profile__body { flex: 1; }
  .dash-profile__headline,
  .dash-profile__email { justify-content: flex-start; }
  .dash-tabs__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-panel { padding: var(--sp-8); }
}

/* ---- Field skin: the account area follows the design (cool ground, cool hairline) -------- */
.dash .input {
  background-color: var(--tint-cool);
  border-color: var(--line-cool);
}
.dash .input:focus {
  background-color: var(--surface);
  border-color: var(--burgundy);
}
.dash .input[readonly] {
  background-color: var(--gray);
  color: var(--text-muted);
}

/* ---- Motion (first screen, runs once on load; CSS only) ------------------------
   The profile card rises, the tab bar fades in under it, then the first list items
   fall in one after another (at most five) and the panel of the form pages rises. */
@media (prefers-reduced-motion: no-preference) {
  .dash-profile { animation: rise-in var(--t-slow) var(--ease) both; }
  .dash-tabs { animation: dash-fade var(--t-slow) var(--ease-soft) .2s both; }
  .dash-panel { animation: rise-in var(--t-slow) var(--ease) .3s both; }
  .dash-list__items > [data-item] { animation: dash-item-drop var(--t-slow) var(--ease-drop) both; }
  .dash-list__items > [data-item]:nth-child(1) { animation-delay: .35s; }
  .dash-list__items > [data-item]:nth-child(2) { animation-delay: .48s; }
  .dash-list__items > [data-item]:nth-child(3) { animation-delay: .61s; }
  .dash-list__items > [data-item]:nth-child(4) { animation-delay: .74s; }
  .dash-list__items > [data-item]:nth-child(5) { animation-delay: .87s; }
}
@keyframes dash-fade { from { opacity: 0; } }
/* list items fall a short way and settle with a small overshoot */
@keyframes dash-item-drop {
  from { opacity: 0; translate: 0 -24px; scale: .98; }
}
