/* ============================================================
   H&P DASHBOARD — SHARED COMPONENTS
   Cards, buttons, headers, terminals, row states
   ============================================================ */

/* ============================================================
   PAGE LAYOUT
   ============================================================ */

.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-bottom: 60px;
}

/* Section column — 600px max, centered within page */
.section-col {
  width: min(var(--section-col), calc(100% - 20px));
  margin: 0 auto;
}

/* Card wrapper — 424px, centered within section-col */
.card-wrap {
  width: min(var(--card-width), 100%);
  margin: 0 auto;
}

/* ============================================================
   SECTION LAYOUT
   ============================================================ */

.section {
  margin-top: var(--gap-section);
}

.section:first-child {
  margin-top: 20px;
}

.subsection {
  margin-top: var(--gap-sub);
}

/* ============================================================
   SECTION HEADING (24px peach above card)
   ============================================================ */

.section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 0 6px 0;
  /* Left-align with card — within section-col, card is centered 88px in from each edge */
  padding-left: calc((min(var(--section-col), calc(100% - 20px)) - min(var(--card-width), 100%)) / 2);
}

.section-title-text {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 24px;
  line-height: 35px;
  letter-spacing: 2.4px;
  color: var(--peach);
  text-transform: uppercase;
}

/* Small icon beside section title (e.g. @ icon next to COMMS STATUS) */
.section-title-icon {
  display: inline-flex;
  align-items: center;
  color: var(--peach);
  opacity: 0.6;
  margin-left: 4px;
}

/* ============================================================
   SECTION HEADER BAR (peach bar with title + count)
   ============================================================ */

.section-header {
  width: 100%;
  height: 60px;
  background: var(--peach);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--card-pad-r) 0 var(--card-pad-l);
}

.section-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 51px; /* peach bg is 51px, total slot is 60px */
}

.section-header-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 18px;
  line-height: 35px;
  letter-spacing: 1.8px;
  color: var(--on-peach);
  text-transform: uppercase;
}

.section-header-right {
  text-align: right;
  flex-shrink: 0;
}

.section-header-label {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: 0;
  color: var(--on-peach-dim);
  text-transform: uppercase;
  display: block;
}

.section-header-count {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 35px;
  color: var(--on-peach);
  display: block;
}

.section-header-sub {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: 0;
  color: var(--on-peach);
  text-transform: uppercase;
  position: absolute;
  bottom: 3px;
  right: var(--card-pad-r);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  width: 100%;
  background: var(--bg2);
  border: var(--border-w) solid var(--border);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  position: relative;
  overflow: visible;
}

/* Card body: left col + right col */
.card-body {
  display: flex;
  padding: var(--card-pad-t) var(--card-pad-r) 0 0;
  min-height: 80px;
}

.card-left {
  width: var(--left-col);
  min-width: var(--left-col);
  padding: 0 0 0 var(--card-pad-l);
  flex-shrink: 0;
  position: relative;
}

.card-right {
  flex: 1;
  min-width: 0;
}

/* Date and type labels */
.card-date {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: 0;
  color: var(--peach);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.card-type {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: 0;
  color: var(--peach-25);
  text-transform: uppercase;
}

/* Icon row below date/type */
.card-icons {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
}

.card-icons .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-dim { opacity: 0.25; }

/* Right col content */
.card-name {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: 0;
  color: var(--peach);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.card-name-dim {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 14px;
  color: var(--peach-25);
  text-transform: uppercase;
}

.card-venue {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 14px;
  color: var(--peach-25);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.card-pkg {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 14px;
  color: var(--peach);
  text-transform: uppercase;
}

.card-event-line {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 14px;
  color: var(--peach-25);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.card-last-contact-label {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 14px;
  color: var(--peach-25);
  text-transform: uppercase;
}

.card-last-contact-date {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 14px;
  color: var(--peach);
  text-transform: uppercase;
}

.card-preview {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 10px;
  line-height: 12px;
  color: var(--peach);
  margin-top: 2px;
}

/* ============================================================
   BUTTON ROW (bottom of card)
   ============================================================ */

.card-btns {
  display: flex;
  align-items: center;
  padding: 0 0 0 var(--card-pad-l);
  margin-top: 8px;
}

/* Right-side icon buttons (G, Hb) pinned to card right */
.card-btns-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-right: var(--card-pad-r);
}

/* Base button */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 25px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  outline: none;
  transition: opacity 0.15s;
}

/* Inactive: semi-dark bg, very dim peach text */
.btn-inactive {
  background: rgba(43,43,43,0.5);
  color: var(--peach-20);
  padding: 0 12px;
}

/* Selected/active expand state */
.btn-selected {
  background: var(--bg);
  color: var(--peach);
  padding: 0 10px;
}

/* Primary actions by state */
.btn-peach   { background: var(--peach); color: var(--on-peach); padding: 0 10px; }
.btn-red     { background: var(--red);   color: var(--on-peach); padding: 0 10px; }
.btn-green   { background: var(--green); color: var(--on-peach); padding: 0 10px; }

/* Dim secondaries */
.btn-dim-peach { background: var(--peach-20); color: rgba(43,43,43,0.5); padding: 0 10px; }
.btn-dim-red   { background: var(--red-20);   color: rgba(43,43,43,0.5); padding: 0 10px; }
.btn-dim-green { background: var(--green-20); color: rgba(43,43,43,0.5); padding: 0 10px; }

/* Outline buttons (Draft Reply panel) */
.btn-outline {
  background: transparent;
  border: 0.5px solid var(--border);
  color: var(--peach);
  padding: 0 10px;
}
.btn-outline-red   { border-color: var(--border); color: var(--red); }
.btn-outline-green { border-color: var(--border); color: var(--green); }

/* Pill / save feedback button */
.btn-pill {
  background: var(--peach-25);
  color: var(--on-peach);
  padding: 0 16px;
  border-radius: var(--radius-save);
  height: 22px;
}

/* ============================================================
   ROW STATE MODIFIERS
   ============================================================ */

/* Default: standard peach */
.row-default { border-color: var(--border); }

/* Urgent: red border, red text overrides */
.row-urgent {
  border: 1px solid var(--red) !important;
}
.row-urgent .card-date,
.row-urgent .card-name,
.row-urgent .card-pkg     { color: var(--red); }
.row-urgent .card-type    { color: var(--red-25); }
.row-urgent .card-event-line { color: var(--red-25); }
.row-urgent .card-preview { color: var(--red); }
.row-urgent .card-last-contact-date { color: var(--red); }
.row-urgent .card-last-contact-label { color: var(--red-25); }
.row-urgent .icon         { color: var(--red); }

/* Confirmed: standard, CONFIRMED button */
/* (no extra styles needed — just uses .btn-peach on secondary button) */

/* Dormant: green tint throughout */
.row-dormant .card-date,
.row-dormant .card-name,
.row-dormant .card-pkg         { color: var(--green); }
.row-dormant .card-type        { color: var(--green-50); }
.row-dormant .card-event-line  { color: var(--green-50); }
.row-dormant .card-preview     { color: var(--green); }
.row-dormant .card-last-contact-date  { color: var(--green); }
.row-dormant .card-last-contact-label { color: var(--green-50); }
.row-dormant .card-venue       { color: var(--green-50); }
.row-dormant .icon             { color: var(--green); }

/* ============================================================
   TERMINAL / VIEWPORT PANELS
   ============================================================ */

.terminal {
  width: 100%;
  background: var(--bg);
  border-radius: var(--radius-card);
  position: relative;
  padding: 10px 14px 12px 16px;
  display: none; /* hidden by default, shown when expanded */
}

.terminal.is-open { display: block; }

.terminal-text {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 10px;
  line-height: 12px;
  letter-spacing: 1px;
  color: var(--peach);
}

.terminal-text.is-urgent  { color: var(--red); }
.terminal-text.is-dormant { color: var(--green); }
.terminal-text.is-white   { color: var(--white-body); }

.terminal ul {
  list-style: disc;
  padding-left: 14px;
  margin-bottom: 8px;
}

.terminal li {
  margin-bottom: 2px;
}

.terminal-head {
  font-weight: 700;
  font-size: 10px;
  line-height: 10px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

/* Minimize button — positioned top-right corner of terminal */
.btn-minimize {
  position: absolute;
  top: 8px;
  right: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--peach);
  background: none;
  border: none;
  padding: 2px;
}
.btn-minimize.is-urgent  { color: var(--red); }
.btn-minimize.is-dormant { color: var(--green); }

/* ============================================================
   SCROLL DOTS (Mail Station right edge)
   ============================================================ */

.scroll-dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: absolute;
  right: -16px;
  top: 0;
  bottom: 0;
  width: 8px;
}

.scroll-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--peach);
  opacity: 0.2;
  transition: opacity 0.2s;
}

.scroll-dot.is-active { opacity: 1; }

/* ============================================================
   NAV BAR
   ============================================================ */

.nav {
  background: var(--peach);
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  height: 70px;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-logo {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-buttons {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 25px;
  padding: 0 20px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: var(--peach);
  color: var(--on-peach);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-btn.is-active {
  background: var(--bg);
  color: var(--peach);
}

/* Hamburger (mobile) */
.nav-hamburger {
  display: none;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--on-peach);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

/* Mobile dropdown */
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--peach);
  flex-direction: column;
  z-index: 200;
}

.nav-dropdown.is-open { display: flex; }

.nav-dropdown .nav-btn {
  height: 35px;
  width: 100%;
  justify-content: center;
  border-top: 0.5px solid rgba(59,59,59,0.15);
}

.nav-sync {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-sync-time {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 8px;
  line-height: 35px;
  color: var(--bg);
  white-space: nowrap;
}

.nav-sync-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  cursor: pointer;
}

/* ============================================================
   LEGEND PILLS (Comms Status bottom)
   ============================================================ */

.legend-pills {
  display: flex;
  align-items: center;
  width: 234px;
  height: 21px;
  margin: 12px auto 0;
}

.legend-pill {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--on-peach);
}

.legend-pill-green {
  background: var(--green-50);
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
}

.legend-pill-peach {
  background: rgba(255,190,159,0.5);
}

.legend-pill-red {
  background: var(--red-50);
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
}

/* ============================================================
   ACCOUNT LABELS (Mail header)
   ============================================================ */

.acct-label {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 10px;
  line-height: 10px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--on-peach);
}

.acct-label.is-dim {
  color: rgba(59,59,59,0.2);
}

/* ============================================================
   EMAIL / TIMESTAMP ROW
   ============================================================ */

.card-email {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 14px;
  color: var(--peach-25);
  text-transform: uppercase;
}

.card-timestamp {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 14px;
  color: var(--peach);
}

.card-timestamp-dim {
  color: var(--peach-20);
}

/* ============================================================
   DRAFT REPLY PANEL
   ============================================================ */

.draft-header {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 10px;
  line-height: 10px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--peach);
  margin-bottom: 8px;
}

.draft-header-dim {
  color: var(--peach-25);
}

.draft-body-box {
  border: 0.5px solid var(--border);
  padding: 8px 10px;
  margin-bottom: 6px;
}

.draft-body-text {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 10px;
  line-height: 12px;
  color: var(--white-body);
}

.draft-feedback-box {
  border: 0.5px solid var(--border);
  padding: 8px 10px;
  margin-bottom: 8px;
}

.draft-feedback-placeholder {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 10px;
  line-height: 12px;
  color: var(--white-body);
  opacity: 0.5;
}

.draft-quality-label {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 10px;
  line-height: 12px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--peach-25);
}

/* ============================================================
   PAYMENT PROGRESS BAR
   ============================================================ */

.progress-bar {
  height: 4px;
  background: rgba(255,190,159,0.15);
  border-radius: 2px;
  overflow: hidden;
  margin: 6px 0;
}

.progress-fill {
  height: 100%;
  background: var(--peach);
  border-radius: 2px;
  transition: width 0.3s;
}

.progress-fill.is-paid   { background: var(--green); }
.progress-fill.is-urgent { background: var(--red); }

/* ============================================================
   STATUS BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-peach  { background: var(--peach-25); color: var(--peach); }
.badge-red    { background: var(--red-25);   color: var(--red);   }
.badge-green  { background: var(--green-50); color: var(--on-peach); }

/* ============================================================
   PRIORITY PILLS (Tasks)
   ============================================================ */

.priority-pill {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.priority-high   { background: var(--red-25);   color: var(--red);   }
.priority-medium { background: var(--peach-25);  color: var(--peach); }
.priority-low    { background: rgba(126,121,121,0.2); color: var(--dim-text); }

/* ============================================================
   RESPONSIVE — MOBILE (<600px)
   ============================================================ */

@media (max-width: 600px) {
  .nav-buttons { display: none; }
  .nav-hamburger { display: flex; }

  .section-col {
    width: calc(100% - 20px);
  }

  .card-wrap {
    width: 100%;
  }

  .terminal {
    width: 100%;
  }
}
