/* Portal-only. Everything shared comes from ../_style.css. */

/* --- masthead -------------------------------------------------------- */
.masthead .who { color: var(--muted); font-size: .92rem; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer;
           font: inherit; font-weight: 600; font-size: .93rem; padding: 8px 4px; }
.linkbtn:hover { color: var(--accent-2); text-decoration: underline; }
.loading { color: var(--muted); padding: 48px 0; }

/* Account.
   Desktop shows the email and Sign out inline. A phone folds them behind a
   compact control: header space is scarce, and an address long enough to be
   useful is long enough to wreck the row. */
.acct { position: relative; display: flex; align-items: center; gap: 14px; }
.acctbtn { display: none; background: none; border: 1px solid var(--border-2);
           border-radius: 8px; color: var(--ink-2); font-size: 1.05rem; line-height: 1;
           padding: 7px 12px; cursor: pointer; }
.acctbtn:hover, .acctbtn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.acctmenu { display: flex; align-items: center; gap: 14px; }

@media (max-width: 700px) {
  .masthead .bar { padding: 12px 20px; }
  .mark b { font-size: .95rem; }
  .mark { flex-wrap: wrap; gap: 8px; }
  .mark .tag { font-size: .62rem; padding: 2px 7px; }
  .acctbtn { display: block; }
  .acctmenu { display: none; position: absolute; top: calc(100% + 9px); right: 0;
              flex-direction: column; align-items: flex-start; gap: 10px;
              background: var(--surface); border: 1px solid var(--border);
              border-radius: 10px; box-shadow: var(--shadow-l);
              padding: 13px 16px; min-width: 190px; z-index: 20; }
  .acct.open .acctmenu { display: flex; }
  .acctmenu .who { font-size: .86rem; word-break: break-all; }
  .acctmenu .linkbtn { padding: 0; }
}

/* --- signed out ------------------------------------------------------ */
.signin { display: flex; justify-content: center; padding: 56px 0 88px; }
.signincard { max-width: 430px; width: 100%; padding: 30px; }
.signincard h2 { margin-bottom: 10px; }
.signincard p { color: var(--ink-2); font-size: .96rem; }
.signincard .req { color: var(--muted); font-size: .9rem; }
.autherr { background: #fdf6e8; border: 1px solid #f0dfb8; border-left: 4px solid var(--warn);
           color: var(--warn); padding: 12px 16px; border-radius: 0 8px 8px 0;
           font-size: .92rem; margin: 16px 0 0; }
.autherr.info { background: var(--tint); border-color: #cfe0f4;
                border-left-color: var(--accent); color: var(--ink-2); }

/* --- workspace: same markup, different order per breakpoint ---------- */
.grid4 { display: grid; gap: 40px 44px; padding: 34px 0 72px;
         grid-template-columns: 58fr 42fr;
         grid-template-areas:
           "status  install"
           "matls   invite"; align-items: start; }
.blk-status    { grid-area: status; }
.blk-install   { grid-area: install; }
.blk-materials { grid-area: matls; }
.blk-invite    { grid-area: invite; }

/* Phone: Install leads. The first thing a new technician needs is the app,
   not a dashboard of zeroes. */
@media (max-width: 940px) {
  .grid4 { grid-template-columns: 1fr; gap: 30px; padding: 22px 0 48px;
           grid-template-areas: "install" "status" "matls" "invite"; }
}

.blk h2 { margin-bottom: 4px; }
.blk .sub { margin-bottom: 16px; }
@media (max-width: 940px) { .blk .sub { font-size: .93rem; margin-bottom: 14px; } }

.pagehead { padding: 0 0 4px; }
.pagehead h1 { font-size: clamp(1.5rem, 2.6vw, 2.05rem); margin-bottom: 6px; }

/* --- metric cards ---------------------------------------------------- */
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
           gap: 14px; margin: 6px 0 14px; }
@media (min-width: 1180px) { .metrics { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.metric { background: var(--surface); border: 1px solid var(--border);
          border-radius: var(--r); padding: 18px 18px 16px; box-shadow: var(--shadow); }
.metric .v { font-size: 2.1rem; font-weight: 650; letter-spacing: -0.03em;
             line-height: 1.02; color: var(--ink); }
.metric.zero .v { color: var(--muted); }
.metric .k { font-size: .87rem; font-weight: 600; color: var(--ink-2); margin-top: 5px; }
.metric .d { font-size: .8rem; color: var(--muted); margin-top: 3px; line-height: 1.4; }
/* Four per-card info buttons were noise: tiny targets repeating what the
   single disclosure below already explains properly. */
@media (max-width: 520px) {
  .metrics { gap: 12px; }
  .metric { padding: 15px 15px 14px; }
  .metric .v { font-size: 1.85rem; }
  .metric .d { display: none; }
}

.explain { margin: 4px 0 0; }
.explain summary { cursor: pointer; color: var(--accent); font-size: .93rem;
                   font-weight: 600; padding: 8px 0; }
.explain > div { color: var(--ink-2); font-size: .92rem; padding: 8px 0 0; max-width: 68ch; }
.explain table { border-collapse: collapse; margin-top: 10px; font-size: .9rem; }
.explain td { padding: 5px 22px 5px 0; color: var(--ink-2); }
.explain td:first-child { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); }

.zerostate { background: var(--tint); border: 1px solid #cfe0f4; border-radius: var(--r);
             padding: 18px 20px; margin: 14px 0 4px; }
.zerostate h3 { margin: 0 0 6px; color: var(--ink); }
.zerostate p { margin: 0; color: var(--ink-2); font-size: .94rem; }

/* --- resource cards -------------------------------------------------- */
.reslist { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
@media (max-width: 620px) { .reslist { grid-template-columns: 1fr; gap: 12px; } }
.res { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
       padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.res .ico { color: var(--accent); margin-bottom: 10px; line-height: 0; }
.res h3 { margin: 0 0 4px; font-size: 1rem; }
.res p { color: var(--ink-2); font-size: .9rem; margin: 0 0 12px; flex: 1; line-height: 1.45; }
.res .acts { display: flex; gap: 16px; flex-wrap: wrap; }
.res a { font-size: .92rem; font-weight: 600; text-decoration: none; }
.res a:hover { text-decoration: underline; }
.empty { color: var(--muted); font-size: .94rem; }
/* On a phone the icon costs a whole line for nothing: put it beside the title. */
@media (max-width: 620px) {
  .res { padding: 15px 16px; display: grid; grid-template-columns: auto 1fr;
         grid-template-areas: "ico title" ". body" ". acts"; column-gap: 11px; row-gap: 2px; }
  .res .ico { grid-area: ico; margin: 1px 0 0; }
  .res h3 { grid-area: title; }
  .res p { grid-area: body; margin-bottom: 8px; }
  .res .acts { grid-area: acts; }
}

.installs { display: flex; flex-direction: column; gap: 12px; }

/* --- invite panel ---------------------------------------------------- */
.panel { padding: 20px; }
.panel label { display: block; font-size: .8rem; font-weight: 650; color: var(--ink-2);
               margin: 0 0 6px; }
.panel input, .panel select { width: 100%; padding: 11px 13px; font: inherit; font-size: .95rem;
  color: var(--ink); background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 9px; }
.panel input:focus, .panel select:focus { border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px rgba(21,101,192,.16); }
.panel .rolehint { margin: 7px 0 0; font-size: .82rem; color: var(--muted); }
.panel .row2 { display: flex; gap: 12px; margin: 14px 0 16px; }
.panel .row2 > span { flex: 1; }

.codes { background: var(--surface); border: 2px solid var(--accent); border-radius: var(--r);
         padding: 20px; margin: 16px 0 0; box-shadow: var(--shadow-l); }
.codes h3 { margin: 0 0 4px; }
.codes .once { color: var(--warn); font-size: .87rem; margin: 0 0 14px; }
.codes .roleout { font-size: .85rem; font-weight: 650; margin: 0 0 14px;
  padding: 8px 11px; border-radius: 7px; }
.codes .roleout.is-pilot { color: var(--ink); background: var(--tint); }
.codes .roleout.is-test  { color: var(--ink-2); background: var(--tint); }
.codes .code { margin-bottom: 8px; }
.codes .lnk { font-size: .8rem; color: var(--muted); word-break: break-all;
              margin: 0 0 16px; user-select: all; -webkit-user-select: all; }
