/* ================= Top bar ================= */
.cell--topbar {
  background: linear-gradient(180deg, var(--color-navy-700), var(--color-navy-800));
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
  font-size: 0.85rem;
}

.topbar-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.brand { font-weight: 800; letter-spacing: 0.5px; font-size: 1rem; }

.page-tabs { display: flex; gap: 6px; }
.tab {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--color-text-inverse);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}
.tab--active { background: var(--color-panel); color: var(--color-navy-700); font-weight: 600; }

.topbar-ticker {
  flex: 1;
  min-width: 0;
  max-width: min(52vw, 36rem);
  margin: 0 auto;
  color: #1d4ed8;
  font-weight: 600;
  font-size: calc(1em + 4px);
  pointer-events: none;
}

.topbar-ticker__inner {
  overflow: hidden;
  width: 100%;
  min-width: 0;
}

.topbar-ticker__track {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}

.topbar-ticker__track--scroll {
  animation: topbar-ticker-marquee var(--topbar-ticker-duration, 18s) linear infinite;
}

@keyframes topbar-ticker-marquee {
  0% {
    transform: translateX(var(--topbar-ticker-start, 100%));
  }
  100% {
    transform: translateX(var(--topbar-ticker-end, -100%));
  }
}

.topbar-ticker--empty {
  visibility: hidden;
}

.topbar-clock {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.75rem;
  opacity: 0.9;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.topbar-clock__date {
  min-width: 10ch;
}

.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-stats { display: flex; gap: 6px; align-items: center; min-width: 0; }

/* Legacy stat-pill (fallback) */
.stat-pill {
  background: rgba(255,255,255,0.9);
  color: var(--color-navy-800);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

/* myprj-web toolbar-live SET strip */
.toolbar-live__set {
  background: var(--toolbar-live-set-bg);
  border: 1px solid var(--toolbar-live-set-border);
  border-radius: 6px;
  padding: 0 6px;
  font-size: var(--font-size-toolbar-live);
  font-weight: 400;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  line-height: 1.15;
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  min-height: 0;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.toolbar-live__lbl {
  color: var(--toolbar-live-lbl);
  font-weight: 400;
  margin-right: 2px;
}
.toolbar-live__lbl--set {
  color: var(--toolbar-live-set-val);
  font-weight: 500;
}
.toolbar-live__lbl--val {
  color: var(--toolbar-live-val-val);
  font-weight: 500;
}
.toolbar-live__lbl--win {
  color: var(--toolbar-live-win);
  font-weight: 500;
}
.toolbar-live__lbl--status {
  color: var(--toolbar-live-open);
  font-weight: 500;
}
.toolbar-live__sep {
  color: var(--toolbar-live-lbl);
  margin: 0 1px;
}

/* myprj-web split SET / Val / W / status boxes */
.toolbar-live__set {
  display: inline-flex !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
}
.tb-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  min-width: 0;
}
.tb-lbl {
  font-size: 0.68rem;
  color: var(--toolbar-live-lbl);
  font-weight: 500;
  white-space: nowrap;
}
.tb-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.35rem;
  padding: 2px 6px;
  border: 1px solid var(--toolbar-live-set-border);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  font-size: var(--font-size-toolbar-live);
  font-weight: var(--toolbar-live-weight);
  white-space: nowrap;
  line-height: 1.25;
  min-width: 2.4em;
  position: relative;
}
.tb-box:not(.flash-highlight) {
  background: var(--toolbar-live-set-bg);
}
.tb-box--set {
  color: var(--toolbar-live-set-val);
  min-width: 5.5em;
}
.tb-box--val {
  color: var(--toolbar-live-val-val);
  min-width: 5.5em;
}
.tb-box--win {
  color: var(--toolbar-live-win);
  min-width: 1.8em;
}
.tb-box--status {
  min-width: 4.5em;
  max-width: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--toolbar-live-open);
}
.tb-box--status.tb-box--open {
  color: var(--toolbar-live-open);
}
.tb-box--status.tb-box--pre {
  color: var(--toolbar-live-pre);
}
.tb-box--status.tb-box--closed {
  color: var(--toolbar-live-closed);
}

.toolbar-live__val {
  display: inline-block;
  border-radius: 2px;
  font-weight: var(--toolbar-live-weight);
}
.toolbar-live__val[data-topbar-part^="set-"],
.toolbar-live__val--set {
  color: var(--toolbar-live-set-val);
}
.toolbar-live__val[data-topbar-part^="val-"],
.toolbar-live__val--val {
  color: var(--toolbar-live-val-val);
}
.toolbar-live__val[data-topbar-field="winSet"],
.toolbar-live__val[data-topbar-field="winVal"],
.toolbar-live__val--win {
  color: var(--toolbar-live-win);
}
.toolbar-live__val--status {
  font-weight: var(--toolbar-live-weight);
}
.toolbar-live__val--status.toolbar-live__val--open {
  color: var(--toolbar-live-open);
}
.toolbar-live__val--status.toolbar-live__val--pre {
  color: var(--toolbar-live-pre);
}
.toolbar-live__val--status.toolbar-live__val--closed {
  color: var(--toolbar-live-closed);
}

/* SET market status + flash — aligned with myprj-web toolbar-live */
.stat-pill--status {
  border: 1px solid rgba(15, 23, 42, 0.12);
}
.stat-pill__val {
  display: inline;
  border-radius: 2px;
}
.stat-pill__val--status {
  font-weight: 700;
}
.stat-pill__val--open {
  color: #1d4ed8;
}
.stat-pill__val--pre {
  color: #1d4ed8;
}
.stat-pill__val--closed {
  color: #1d4ed8;
}
.stat-pill--status:has(.stat-pill__val--open) {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.stat-pill--status:has(.stat-pill__val--pre) {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.stat-pill--status:has(.stat-pill__val--closed) {
  background: #eff6ff;
  border-color: #bfdbfe;
}
@keyframes flash-highlight-keyframes {
  0%,
  40% {
    background: #a3adb8;
    background-color: #a3adb8;
    box-shadow: inset 0 0 0 999px #a3adb8;
  }
  100% {
    background: var(--toolbar-live-set-bg);
    background-color: var(--toolbar-live-set-bg);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  }
}
@keyframes tb-poll-tick-keyframes {
  0% {
    background: rgba(163, 173, 184, 0.92) !important;
    background-color: rgba(163, 173, 184, 0.92) !important;
    box-shadow: 0 0 0 0 rgba(3, 105, 161, 0.55);
    border-color: #38bdf8;
  }
  100% {
    background: var(--toolbar-live-set-bg);
    background-color: var(--toolbar-live-set-bg);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  }
}
.flash-highlight,
.tb-box.flash-highlight,
.stat-pill__val.flash-highlight,
.toolbar-live__val.flash-highlight {
  background: #a3adb8 !important;
  background-color: #a3adb8 !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 999px #a3adb8 !important;
  animation: none !important;
  border-radius: 2px;
}
.tb-box > .tb-flash-fill {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: #a3adb8 !important;
  transition: opacity 0.35s ease-out;
}
.tb-box > .tb-poll-fill {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: rgba(163, 173, 184, 0.88) !important;
  animation: tb-poll-fill-keyframes 0.55s ease-out forwards;
}
@keyframes tb-poll-fill-keyframes {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.tb-box.flash-highlight,
.tb-box.tb-box--poll-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 1.35rem;
  padding: 2px 6px;
  border: 1px solid var(--toolbar-live-set-border);
  border-radius: 3px;
}
.tb-box.tb-box--poll-tick {
  animation: tb-poll-tick-keyframes 0.45s ease-out;
}

.topbar-clock__time {
  min-width: 11ch;
  text-align: right;
}

.lang-select {
  background: transparent;
  color: var(--color-text-inverse);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: 0.75rem;
}
.lang-select option { color: var(--color-text); }

.btn { border: none; cursor: pointer; border-radius: var(--radius-sm); font-family: inherit; }
.btn--signout {
  background: var(--color-accent-red);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 6px 10px;
}
.btn--signout:hover { filter: brightness(1.08); }

/* ================= Sidebar ================= */
.cell--sidebar {
  background: #e8ecf1;
  color: var(--color-text);
  padding: 8px 6px;
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-row {
  background: var(--color-panel);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: inherit;
  padding: 8px 12px;
  min-height: 36px;
  font-size: 0.8125rem; /* 13px */
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover { background: rgba(15, 23, 42, 0.04); }
.nav-item--active {
  font-weight: 600;
  background: rgba(15, 23, 42, 0.06);
}
.nav-parent {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.8125rem; /* 13px */
}

/* Collapsible section headers (independent toggle, not an accordion) */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
  padding: 8px 12px;
  min-height: 36px;
  border-left: 4px solid var(--row-accent, #3b82c4);
  background: var(--row-header-bg, #f8fafc);
  color: var(--row-header-text, var(--color-text));
}
.nav-toggle:hover {
  background: var(--row-header-bg-hover, #f1f5f9);
}
.nav-toggle[aria-expanded="true"] {
  background: var(--row-header-bg-open, #eef2f7);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.65);
}
.nav-toggle__label { flex: 1; text-align: left; min-width: 0; }
.chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  font-size: 0.5rem;
  line-height: 1;
  color: var(--row-accent, #3b82c4);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, background 0.12s ease;
}
.nav-toggle:hover .chevron {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.14);
}
.nav-toggle[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
  background: var(--row-accent, #3b82c4);
  color: #fff;
  border-color: transparent;
}

.submenu {
  display: none;
  flex-direction: column;
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.03);
}
.submenu[data-open="true"] {
  display: flex;
}
.submenu .nav-item {
  padding: 6px 16px 6px 28px;
  min-height: 0;
  font-size: 0.75rem; /* 12px */
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text);
  border-left: 4px solid transparent;
  position: relative;
}
.submenu .nav-item + .nav-item {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.submenu .nav-item:hover {
  background: #f4f7fb;
  color: var(--row-accent, #3b82c4);
}
.submenu .nav-item--active {
  background: var(--row-active-bg, #eef4ff);
  color: var(--row-accent, #3b82c4);
  font-weight: 600;
  border-left-color: var(--row-accent, #3b82c4);
}
/* Small colored square bullet in front of every sub-item */
.submenu .nav-item::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--row-accent, #3b82c4);
  border-radius: 50%;
  opacity: 0.55;
}
.submenu .nav-item--active::before,
.submenu .nav-item:hover::before {
  opacity: 1;
}

/* ---- Section accent colors: strong header strip + neutral submenu ---- */
.nav-row--account,
.nav-row--announce {
  --row-accent: #5b6f94;
  --row-header-bg: #eef2f7;
  --row-header-bg-hover: #e6ebf2;
  --row-header-bg-open: #dfe6ef;
  --row-header-text: #334155;
  --row-active-bg: #eef2f7;
}

.nav-row--period {
  --row-accent: #7c3aed;
  --row-header-bg: #f3ebff;
  --row-header-bg-hover: #ebe0ff;
  --row-header-bg-open: #e2d4ff;
  --row-header-text: #5b21b6;
  --row-active-bg: #f5f0ff;
}

.nav-row--member {
  --row-accent: #059669;
  --row-header-bg: #e8f8ef;
  --row-header-bg-hover: #dff3e8;
  --row-header-bg-open: #d4eddf;
  --row-header-text: #047857;
  --row-active-bg: #ecfdf5;
}

.nav-row--summary {
  --row-accent: #d97706;
  --row-header-bg: #fff4db;
  --row-header-bg-hover: #ffefcc;
  --row-header-bg-open: #ffe8b8;
  --row-header-text: #92400e;
  --row-active-bg: #fffbeb;
}

.nav-row--report {
  --row-accent: #2563eb;
  --row-header-bg: #e8f0fe;
  --row-header-bg-hover: #dce8fd;
  --row-header-bg-open: #d0e0fc;
  --row-header-text: #1e40af;
  --row-active-bg: #eff6ff;
}

.nav-row--delete {
  --row-accent: #dc2626;
  --row-header-bg: #feecec;
  --row-header-bg-hover: #fde2e2;
  --row-header-bg-open: #fcd8d8;
  --row-header-text: #991b1b;
  --row-active-bg: #fef2f2;
}

.nav-row--payment {
  --row-accent: #0d9488;
  --row-header-bg: #e6f7f4;
  --row-header-bg-hover: #daf1ed;
  --row-header-bg-open: #ccebe5;
  --row-header-text: #0f766e;
  --row-active-bg: #ecfdf5;
}

/* Direct-page top-level buttons share the same header strip look */
.nav-row--account > .nav-item,
.nav-row--announce > .nav-item,
.nav-row--payment > .nav-item {
  border-left: 4px solid var(--row-accent);
  background: var(--row-header-bg);
  color: var(--row-header-text);
  border-radius: 5px;
}
.nav-row--account > .nav-item:hover,
.nav-row--announce > .nav-item:hover,
.nav-row--payment > .nav-item:hover {
  background: var(--row-header-bg-hover);
}
.nav-row--account > .nav-item.nav-item--active,
.nav-row--announce > .nav-item.nav-item--active,
.nav-row--payment > .nav-item.nav-item--active {
  background: var(--row-header-bg-open);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}


/* ================= Shared panel look ================= */
.cell--profile, .cell--server, .cell--week {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  padding: 16px 18px;
}

/* Account top panels — full content visible (Change password / hints not clipped) */
.cell--profile,
.cell--server {
  overflow: visible;
}

/* Week summary scrolls inside its own table wrap, not the whole cell */
.cell--week {
  overflow: hidden;
}

.panel-title { margin: 0 0 2px; font-size: 1.3rem; }
.panel-subtitle { margin: 0 0 12px; color: var(--color-text-muted); font-size: 0.85rem; }

.profile-facts, .server-facts { margin: 0 0 14px; }
.fact-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  font-size: 0.88rem;
  border-bottom: 1px dashed transparent;
}
.fact-row dt { color: var(--color-text-muted); }
.fact-row dd { margin: 0; font-weight: 600; }
.fact-skeleton { height: 14px; background: #eef1f5; border-radius: 4px; margin: 6px 0; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.status-dot--ok { background: var(--color-accent-green); }
.status-dot--warn { background: var(--color-accent-gold); }
.status-dot--down { background: var(--color-accent-red); }

/* Member link box */
.member-link-box {
  background: #eef7f2;
  border: 1px solid #cfe8db;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.member-link-box__title { margin: 0 0 4px; font-size: 0.95rem; color: #1f6b45; }
.member-link-box__desc { margin: 0 0 8px; font-size: 0.78rem; color: var(--color-text-muted); }
.member-link-box__actions { display: flex; gap: 8px; margin-top: 8px; }

.text-input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.btn--primary { background: var(--color-link); color: #fff; padding: 7px 14px; font-size: 0.82rem; font-weight: 600; }
.btn--dark { background: var(--color-btn-dark-bg); color: var(--color-btn-dark-text); padding: 7px 14px; font-size: 0.82rem; font-weight: 600; }
.btn--ghost { background: transparent; color: var(--color-text-muted); padding: 7px 14px; font-size: 0.82rem; border: 1px solid var(--color-border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.password-form { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; max-width: 320px; }
.password-form.hidden { display: none; }
.field-error { color: var(--color-accent-red); font-size: 0.78rem; margin: 0; min-height: 1em; }
.hint-text { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 10px; }

/* API issues list */
.api-issues-title { font-size: 0.9rem; margin: 4px 0 6px; }
.api-issues-list { list-style: none; margin: 0; padding: 0; font-size: 0.82rem; }
.api-issues-list li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #f0f2f5;
  gap: 8px;
}
.api-issues-list .route { font-family: var(--font-mono); color: var(--color-link); }
.api-issues-list .metrics { color: var(--color-text-muted); white-space: nowrap; }

/* ================= Week summary ================= */
.cell--week { display: flex; flex-direction: column; padding: 0; }
.week-header {
  background: var(--color-navy-800);
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
}
.week-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
}
.week-toolbar__desc { flex: 1; font-size: 0.8rem; color: var(--color-text-muted); margin: 0; }
.week-select-label { font-size: 0.78rem; font-weight: 700; color: var(--color-text-muted); }
.week-select { padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); font-size: 0.85rem; }

.week-dual-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: 0;
  padding: 0 12px 12px;
  align-items: stretch;
}
.week-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 2px solid #c62828;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
}
.week-panel__title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  background: #fff5f2;
  border-bottom: 1px solid #c62828;
  color: var(--color-navy-800);
}
/* Owner sheet: right table banner = admin login (e.g. TLO) */
.week-panel__title--admin {
  text-align: center;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #c62828;
  background: #fff;
  padding: 6px 10px;
  border-bottom: 2px solid #c62828;
}
.week-panel .week-table-wrap {
  flex: 1;
  overflow: auto;
  padding: 0;
}
.week-panel .week-table { font-size: 0.78rem; table-layout: fixed; }
.week-panel .week-table thead th,
.week-panel .week-table tbody td,
.week-panel .week-table tfoot td {
  padding: 2px 6px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compact columns — leave room for name / sold / return / payment / total */
.week-table .week-col--com {
  width: 2.6rem;
  max-width: 2.6rem;
  padding-left: 3px;
  padding-right: 3px;
  text-align: center;
}
.week-table .week-col--wamt {
  width: 4.5rem;
  max-width: 4.5rem;
  padding-left: 4px;
  padding-right: 4px;
  text-align: right;
}
.week-table .week-col--x {
  width: 2.2rem;
  max-width: 2.2rem;
  text-align: center;
}
.week-table--periods .week-col--time {
  width: 2.4rem;
  max-width: 2.4rem;
  padding-left: 2px;
  padding-right: 2px;
  text-align: center;
}
.week-table--periods .week-col--wnum {
  width: 2.6rem;
  max-width: 2.6rem;
  padding-left: 3px;
  padding-right: 3px;
  text-align: center;
}
.week-table--periods .week-col--day {
  width: 2.8rem;
  max-width: 3rem;
}
.week-table--accounts .week-col--name {
  width: auto;
  min-width: 4.5rem;
}
.week-table .week-col--sold,
.week-table .week-col--return,
.week-table .week-col--payment,
.week-table .week-col--total {
  text-align: right;
}

.week-table__name--agent { font-weight: 600; }
.week-table__name--member { padding-left: 14px; }

.week-table-wrap { flex: 1; overflow: auto; padding: 0 16px 16px; }
.week-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.week-table thead th {
  text-align: left;
  padding: 4px 8px;
  border: 1px solid #c62828;
  background: #fff5f2;
}
.week-table tbody td {
  padding: 3px 8px;
  border: 1px solid #c62828;
}
.week-table tbody tr:first-child td:first-child { font-weight: 700; }
.week-table__row--empty td { color: #bdbdbd; }
.week-table__num--loss { color: #c62828; font-weight: 700; }
.week-table__num--gain { color: #1b5e20; font-weight: 600; }
.week-table__footer td {
  border-top: 2px solid #c62828;
  border-bottom: 2px solid #c62828;
  background: #fff8f6;
  font-weight: 700;
  color: #c62828;
}

/* Spreadsheet parity — red italic headers, numeric columns centered/right */
.week-table--sheet thead th {
  font-style: italic;
  font-weight: 800;
  color: #c62828;
  text-align: center;
  background: #fff;
  border: 1px solid #111;
  padding: 2px 5px;
  line-height: 1.1;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}
.week-table--sheet tbody td,
.week-table--sheet tfoot td {
  border: 1px solid #111;
  padding: 1px 5px;
  line-height: 1.15;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.week-table--sheet .week-col--name,
.week-table--sheet .week-col--day {
  text-align: left;
  font-weight: 600;
}
.week-table--sheet .week-col--time,
.week-table--sheet .week-col--wnum,
.week-table--sheet .week-col--com,
.week-table--sheet .week-col--x {
  text-align: center;
}
.week-table--sheet .week-col--sold,
.week-table--sheet .week-col--return,
.week-table--sheet .week-col--wamt,
.week-table--sheet .week-col--payment,
.week-table--sheet .week-col--total {
  text-align: right;
}
.week-table--sheet tbody tr:first-child td:first-child { font-weight: 600; }
.week-table--sheet .week-table__footer td {
  border-color: #c62828;
  border-width: 2px 1px;
  color: #111;
}
.week-table--sheet .week-table__footer .week-table__num--loss,
.week-table--sheet .week-col--total.week-table__num--loss {
  color: #c62828;
}

/* Beat staff-frosted-glass !important so Account tables match owner sheet */
#dashboardGrid .week-table--sheet thead th {
  background: #fff !important;
  color: #c62828 !important;
  font-style: italic !important;
  font-weight: 800 !important;
  text-align: center !important;
  border: 1px solid #111 !important;
  padding: 2px 5px !important;
  line-height: 1.1 !important;
}
#dashboardGrid .week-table--sheet tbody td,
#dashboardGrid .week-table--sheet tfoot td {
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #111 !important;
  padding: 1px 5px !important;
  line-height: 1.15 !important;
}
#dashboardGrid .week-table--sheet .week-table__num--loss,
#dashboardGrid .week-table--sheet td.week-table__num--loss {
  color: #c62828 !important;
  font-weight: 700 !important;
}
#dashboardGrid .week-table--sheet .week-table__num--gain,
#dashboardGrid .week-table--sheet td.week-table__num--gain {
  color: #1b5e20 !important;
}
#dashboardGrid .week-table--sheet .week-table__footer td {
  background: #fff8f6 !important;
  border-color: #c62828 !important;
  border-top-width: 2px !important;
  border-bottom-width: 2px !important;
}
#dashboardGrid .week-panel {
  border: 2px solid #c62828 !important;
  border-radius: 0 !important;
  background: #fff !important;
}
#dashboardGrid .week-panel__title--admin {
  color: #c62828 !important;
  background: #fff !important;
  font-style: italic !important;
  text-align: center !important;
}
.table-loading { text-align: center; color: var(--color-text-muted); padding: 16px; }

/* ================= Announce panel ================= */
.cell--announce {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  padding: 16px 18px;
  overflow-y: auto;
}

.announce-intro {
  max-width: 42rem;
}

.announce-form-card {
  max-width: 42rem;
  margin-top: 8px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.announce-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.announce-textarea {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  box-sizing: border-box;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.announce-hint {
  margin: 8px 0 12px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

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

.btn--danger {
  background: var(--color-accent-red);
  color: #fff;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
}

.announce-status {
  margin: 10px 0 0;
  min-height: 1.2em;
  font-size: 0.82rem;
}

.announce-status--ok { color: var(--color-accent-green); font-weight: 600; }
.announce-status--error { color: var(--color-accent-red); font-weight: 600; }
