/* ===========================================================================
 * Shell styles: everything the artifact never needed because it had no login.
 *
 * app.css is a VERBATIM copy of the artifact's stylesheet, so nothing is edited
 * there. This file is loaded after it and adds only:
 *
 *   - the account chip in the header
 *   - the /login page
 *   - the /access page
 *   - the tier-aware tabs and the Owner / My dashboards
 *
 * All of it is built from app.css's own custom properties, so the new surfaces
 * match the console instead of looking bolted on.
 * ======================================================================== */

/* ---- account chip ------------------------------------------------------- */

.acct {
  position: relative;
  flex: 0 0 auto;
}

.acct-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #ECEDEF;
  transition: border-color 0.18s, background 0.18s;
}
.acct-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(245, 137, 30, 0.45);
}

.acct-av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--orange), var(--ember));
  color: var(--ink);
  font-family: "Space Grotesk", Roboto, sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0;
}

.acct-name {
  font-size: 13px;
  font-weight: 500;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-role {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--orange);
  background: rgba(245, 137, 30, 0.14);
  border-radius: 5px;
  padding: 2px 6px;
}

.acct-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 232px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.acct-menu[hidden] {
  display: none;
}

.acct-who {
  padding: 8px 10px 6px;
  display: grid;
  gap: 2px;
}
.acct-who b {
  font-size: 13.5px;
}
.acct-who span {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.acct-blurb {
  padding: 0 10px 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--faint);
  border-bottom: 1px solid var(--line2);
  margin-bottom: 6px;
}

.acct-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.acct-item:hover {
  background: rgba(245, 137, 30, 0.12);
  color: var(--orange);
}

/* ---- shared page furniture (login, access) ------------------------------ */

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.page-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.page-head h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.02em;
}
.page-head .back {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.page-head .back:hover {
  color: var(--orange);
}
.page-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin: 6px 0 22px;
  max-width: 62ch;
  line-height: 1.5;
}

.page-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", Roboto, sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
}
.page-brand .ops {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: linear-gradient(135deg, var(--orange), var(--ember));
  padding: 3px 8px;
  border-radius: 6px;
}

/* ---- login -------------------------------------------------------------- */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(760px 420px at 50% -10%, var(--glow), transparent 70%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 36px 32px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.login-card .page-brand {
  justify-content: center;
  margin-bottom: 28px;
}
.login-card h1 {
  font-size: 20px;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}

.sso {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: var(--ink);
  font-weight: 600;
  font-size: 14.5px;
  transition: box-shadow 0.2s, filter 0.2s;
}
.sso:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(245, 137, 30, 0.3);
  filter: brightness(1.05);
}
.sso:disabled {
  opacity: 0.6;
  cursor: default;
}

.login-err {
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  background: var(--redbg);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 16px;
  text-align: left;
}

/* The note under the button sits in its own band at the foot of the card. */
.login-foot {
  margin: 28px -32px 0;
  padding: 18px 32px 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.login-foot p {
  margin: 0;
  text-wrap: balance;
}
.login-foot p + p {
  margin-top: 4px;
  color: var(--faint);
}
.login-foot b {
  color: var(--text);
  font-weight: 500;
}

/* ---- team & access page ------------------------------------------------ */

.page .card {
  margin-bottom: 16px;
}
.levels summary {
  cursor: pointer;
  list-style: none;
}
.levels summary::-webkit-details-marker {
  display: none;
}
.levels summary h2 {
  display: inline;
  margin: 0;
}
.levels summary::after {
  content: "Show";
  float: right;
  font-size: 12px;
  color: var(--muted);
}
.levels[open] summary::after {
  content: "Hide";
}
.tiers {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px 14px;
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.tiers dt {
  color: var(--text);
  font-weight: 600;
}
.tiers dd {
  margin: 0;
}

.people-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.people-search {
  flex: 1 1 220px;
  min-width: 0;
}
.people-filter {
  flex-wrap: wrap;
}
.people-filter button .faint {
  font-weight: 400;
  margin-left: 2px;
}

.people-add {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line2);
}
.people-add label,
.people-add fieldset {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
}
.people-add .ctl {
  width: 100%;
}
.people-add fieldset {
  grid-column: 1 / -1;
  border: 0;
  padding: 0;
  margin: 0;
}
.people-add legend {
  padding: 0;
  margin-bottom: 5px;
}
.people-add-go {
  grid-column: 1 / -1;
}

.role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.role-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  background: var(--panel);
}
.role-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.role-chip.on {
  border-color: var(--orange);
  color: var(--text);
  background: var(--pastbg);
}
.role-chip:focus-within {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}

/* One grid for the header and every row, so the columns line up. */
.people-head,
.person {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) 150px 120px;
  gap: 12px;
  align-items: center;
}
.people-head {
  margin-top: 18px;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.people {
  list-style: none;
  margin: 0;
  padding: 0;
}
.person {
  padding: 12px 4px;
  border-bottom: 1px solid var(--line2);
}
.person.left {
  opacity: 0.6;
}
.person .ctl {
  width: 100%;
  min-width: 0;
}
.p-name {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.p-name strong {
  font-weight: 600;
}
.p-roles {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.p-rename {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
}
.p-rename .ctl {
  flex: 1 1 auto;
  min-width: 0;
}
.p-rename .btn {
  height: 34px;
  padding: 0 12px;
}
.fxrate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}
.fxrate .cell {
  width: 64px;
}
select.ctl.cur {
  min-width: 76px;
}
.p-tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
}
.p-tag.you {
  color: var(--orange);
  border-color: var(--orange);
}
.p-act {
  text-align: right;
}
.add-signin {
  background: none;
  border: 1px dashed var(--line);
  color: var(--muted);
  border-radius: 8px;
  height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
}
.add-signin:hover:not(:disabled) {
  border-color: var(--orange);
  color: var(--orange);
}
.p-act .rm {
  white-space: nowrap;
}
.p-rolesedit {
  grid-column: 1 / -1;
  padding-top: 4px;
}
.people .empty {
  padding: 20px 4px;
}
.p-leave {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  border-radius: 8px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  font-size: 13px;
}
.p-leave p {
  margin: 0;
}
.p-leave-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 6px 12px;
  align-items: center;
}
.p-leave-row .small {
  display: block;
  font-size: 12px;
  margin-top: 2px;
}
.p-leave-go {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .page {
    padding: 20px 14px 48px;
  }
  .page .card {
    padding: 16px;
  }
  .people-add {
    grid-template-columns: 1fr;
  }
  .people-bar .btn {
    width: 100%;
  }
  .people-head {
    display: none;
  }
  /* Each person becomes a small card: name on top, then email and level. */
  .person {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name act"
      "email email"
      "level level"
      "roles roles";
    gap: 8px 10px;
    padding: 14px 0;
  }
  .p-name {
    grid-area: name;
  }
  .p-act {
    grid-area: act;
    align-self: start;
  }
  .p-email {
    grid-area: email;
  }
  .p-level {
    grid-area: level;
  }
  .p-nolevel {
    display: none;
  }
  .p-rolesedit,
  .p-leave {
    grid-area: roles;
  }
  .p-leave-row {
    grid-template-columns: 1fr;
  }
  .tiers {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .tiers dd {
    margin-bottom: 8px;
  }
}

.msg {
  font-size: 13px;
  border-radius: 8px;
  padding: 9px 12px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
}
.msg.ok {
  border-left: 4px solid var(--green);
  background: var(--greenbg);
}
.msg.bad {
  border-left: 4px solid var(--red);
  background: var(--redbg);
}

.rm {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
  transition: border-color 0.18s, color 0.18s;
}
.rm:hover:not(:disabled) {
  border-color: var(--red);
  color: var(--red);
}
.rm:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ---- tabs by tier -------------------------------------------------------- */

/* app.js hides the tabs a tier may not see. .tab sets its own display, so the
   hidden attribute needs saying out loud. */
.tabs .tab[hidden] {
  display: none !important;
}
a.tab {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
a.tab::before {
  content: "";
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.18);
  margin-right: 12px;
}

/* ---- dashboards ---------------------------------------------------------- */

.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}
@media (max-width: 1100px) {
  .two {
    grid-template-columns: minmax(0, 1fr);
  }
}
.subh {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin: 4px 0 4px;
}
.swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: 0;
}
.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--orange);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.kpi-inline {
  margin: 8px 0 6px;
}
.kpi-inline .big {
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.netbar {
  display: block;
  height: 8px;
  min-width: 2px;
  border-radius: 4px;
  background: var(--green);
}
.netbar.dn {
  background: var(--red);
}
.todos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
  align-items: start;
}
@media (max-width: 900px) {
  .todos {
    grid-template-columns: 1fr;
  }
}
.todo {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--line2);
}
.todo-h {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.todo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
  align-items: center;
}
.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12.5px;
}
.chip:hover {
  border-color: var(--orange);
}
.period-title .ctl {
  margin-left: 10px;
  vertical-align: middle;
  font-size: 13.5px;
  font-weight: 500;
  font-family: Roboto, sans-serif;
}
@media (max-width: 760px) {
  .p-level:has(.p-nolevel) {
    display: none;
  }
}

/* ---- small screens: the console ----------------------------------------- */

@media (max-width: 760px) {
  /* Segmented filters (change log kinds, entry modes, lead source) wrap
     instead of running off the edge. */
  #main .bar .seg {
    flex-wrap: wrap;
    max-width: 100%;
  }
  #main .period-title .ctl {
    display: block;
    margin: 8px 0 0;
    max-width: 100%;
  }
}

/* ---- Overview: the dashboard switcher ------------------------------------ */

.dash-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.dash-switch label {
  font-size: 12.5px;
  color: var(--muted);
}
.dash-switch select {
  min-width: 240px;
  max-width: 100%;
  font-weight: 600;
}

/* ---- POD Setup filters ---------------------------------------------------- */

.podfilter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.podfilter .ctl {
  max-width: 100%;
}
td.hlcol,
th.hlcol {
  background: var(--pastbg);
}
td.hlcell input.txt {
  border-color: var(--orange);
  color: var(--text);
}
@media (max-width: 760px) {
  .dash-switch select {
    min-width: 0;
    flex: 1;
  }
  .podfilter .ctl {
    flex: 1 1 140px;
  }
}
