/* Admin portal styles — brand-aligned (Salling Properties blue), accessibility-first.
   The legacy token names (--brick/--red/--gold) are kept but remapped to the blue
   palette so the whole admin re-themes from these three values. */
:root { --brick:#14568f; --red:#1e73be; --gold:#e0a12a; --ink:#223039; --line:#e3e9ef; --bg:#f4f8fb;
  --font:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif; }
*{box-sizing:border-box} body{margin:0;font-family:var(--font);color:var(--ink);background:var(--bg);line-height:1.6}
a{color:var(--red)} :focus-visible{outline:3px solid #1a5fff;outline-offset:2px}

/* auth */
.auth{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:1.5rem;
  background:linear-gradient(135deg,var(--brick),#5f2316)}
.auth-card{background:#fff;border-radius:12px;box-shadow:0 18px 50px rgba(0,0,0,.3);padding:2rem;width:100%;max-width:400px}
.auth-brand{color:var(--red);margin:0;font-size:1.4rem;text-transform:uppercase;text-align:center}
.auth-sub{margin:.2rem 0 1.25rem;text-align:center;color:#666}
.auth-form{display:grid;gap:.35rem}
.auth-form label{font-weight:600;margin-top:.6rem}
.auth-form input{padding:.65rem .8rem;border:1px solid var(--line);border-radius:6px;font:inherit}
.auth-btn{margin-top:1.1rem;background:var(--red);color:#fff;border:0;padding:.75rem;border-radius:6px;font-weight:700;font-size:1rem;cursor:pointer}
.auth-btn:hover{background:#8f0000}
.auth-error{background:#fde8e8;color:#8f0000;border:1px solid #f5c2c2;padding:.6rem .8rem;border-radius:6px}
.auth-note{color:#444;font-size:.95rem}
.auth-hint{color:#888;font-weight:400;font-size:.85rem}
.auth-qr{display:flex;justify-content:center;margin:1rem 0}
.auth-qr img,.auth-qr canvas{border:8px solid #fff;border-radius:6px}
.auth-secret{text-align:center;font-size:.88rem;color:#555}
.auth-secret code{display:inline-block;margin-top:.25rem;background:var(--bg);padding:.35rem .6rem;border-radius:5px;letter-spacing:.08em;word-break:break-all}

/* dashboard */
.adm-top{background:var(--ink);color:#fff}
.adm-top-inner{max-width:1100px;margin:auto;padding:.7rem 1.25rem;display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap}
.adm-brand{font-weight:700}
.adm-user{display:flex;align-items:center;gap:.6rem;font-size:.9rem}
.adm-role{background:var(--gold);color:#1c1c1c;border-radius:4px;padding:.05rem .45rem;font-weight:700;font-size:.75rem;text-transform:uppercase}
.adm-logout button{background:transparent;border:1px solid #fff;color:#fff;border-radius:5px;padding:.3rem .7rem;cursor:pointer;font:inherit}
.adm-logout{display:inline}
.adm-main{max-width:1100px;margin:auto;padding:1.5rem 1.25rem}
.adm-main h1{color:var(--red)}
.adm-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1.25rem;margin-top:1.25rem}
.adm-card{background:#fff;border:1px solid var(--line);border-radius:10px;padding:1.25rem}
.adm-card h2{margin:0 0 .4rem;color:var(--brick);font-size:1.15rem}
.adm-card p{margin:0 0 .75rem;color:#555;font-size:.95rem}
.adm-soon{display:inline-block;background:var(--bg);color:#777;border-radius:4px;padding:.2rem .55rem;font-size:.8rem;font-weight:600}
.adm-link{font-weight:700;text-decoration:none}

/* ---- editor ---- */
.ed-bar{display:flex;justify-content:space-between;align-items:flex-end;gap:1rem;flex-wrap:wrap;border-bottom:2px solid var(--line);padding-bottom:1rem;margin-bottom:1.25rem}
.ed-bar h1{margin:0;color:var(--red)}
.ed-status{margin:.25rem 0 0;font-size:.9rem;color:#2e7d32;font-weight:600}
.ed-status.is-draft{color:#b26a00}
.ed-actions{display:flex;gap:.5rem;flex-wrap:wrap}
.btn-primary,.btn-secondary,.btn-ghost{border:0;border-radius:6px;padding:.6rem 1.1rem;font:inherit;font-weight:700;cursor:pointer;text-decoration:none;display:inline-block}
.btn-primary{background:var(--red);color:#fff}.btn-primary:hover{background:#8f0000}
.btn-secondary{background:var(--gold);color:#1c1c1c}.btn-secondary:hover{background:#e0a300}
.btn-ghost{background:#fff;color:var(--ink);border:1px solid var(--line)}.btn-ghost:hover{background:var(--bg)}
.btn-primary[disabled],.btn-secondary[disabled]{opacity:.6;cursor:wait}
.btn-add{background:#eef0f1;border:1px dashed #b9c0c5;border-radius:6px;padding:.6rem 1rem;font:inherit;font-weight:600;color:#333;cursor:pointer}
.btn-add.sm{padding:.4rem .8rem;font-size:.9rem;margin:.5rem 0}
.btn-link{background:none;border:0;color:#8f0000;text-decoration:underline;cursor:pointer;font:inherit}
.ed-foot{margin-top:1.5rem}

.category{background:#fff;border:1px solid var(--line);border-radius:10px;padding:1rem 1.1rem;margin-bottom:1.1rem}
.cat-head{display:flex;align-items:flex-end;gap:.6rem;flex-wrap:wrap;border-bottom:1px solid var(--line);padding-bottom:.75rem;margin-bottom:.75rem}
.cat-head .c-name{font-weight:700}
.fld{display:flex;flex-direction:column;gap:.15rem;flex:1 1 140px}
.fld-lbl{font-size:.72rem;text-transform:uppercase;letter-spacing:.03em;color:#777;font-weight:700}
.fld input,.fld textarea{padding:.45rem .55rem;border:1px solid var(--line);border-radius:5px;font:inherit;width:100%}
.fld-chk{display:flex;align-items:center;gap:.3rem;font-size:.85rem;white-space:nowrap;padding-bottom:.4rem}
.mv{display:flex;flex-direction:column;gap:2px}
.mv-btn{border:1px solid var(--line);background:#fff;width:26px;height:20px;line-height:1;border-radius:4px;cursor:pointer;font-size:.7rem;color:#555}
.mv-btn:hover{background:var(--bg)}
.del-btn{background:#fff;border:1px solid #e6b3b3;color:#b00;border-radius:5px;padding:.4rem .6rem;cursor:pointer;font:inherit;font-size:.8rem;white-space:nowrap}
.del-btn:hover{background:#fde8e8}
.item{background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:.7rem .8rem;margin-bottom:.6rem}
.item-row{display:flex;align-items:flex-end;gap:.6rem;flex-wrap:wrap}
.item .i-price{max-width:120px}
.item textarea{margin-top:.4rem}
.addons-lbl{font-size:.78rem;text-transform:uppercase;letter-spacing:.03em;color:#777;font-weight:700;margin:.75rem 0 .3rem}
.addon{display:flex;gap:.5rem;align-items:center;margin-bottom:.4rem}
.addon .a-name{flex:1 1 auto;padding:.4rem .55rem;border:1px solid var(--line);border-radius:5px;font:inherit}
.addon .a-price{width:110px;padding:.4rem .55rem;border:1px solid var(--line);border-radius:5px;font:inherit}

/* ---- pages list ---- */
.adm-table{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.adm-table th,.adm-table td{text-align:left;padding:.7rem .9rem;border-bottom:1px solid var(--line)}
.adm-table th{background:var(--bg);font-size:.78rem;text-transform:uppercase;letter-spacing:.03em;color:#666}
.adm-table tr:last-child td{border-bottom:0}
.btn-secondary.sm{padding:.35rem .8rem;font-size:.85rem}
.pill-draft{background:#fff3e0;color:#b26a00;border:1px solid #f0c98a;border-radius:4px;padding:.1rem .5rem;font-size:.8rem;font-weight:700}
.pill-live{background:#e8f5e9;color:#2e7d32;border:1px solid #b6dab9;border-radius:4px;padding:.1rem .5rem;font-size:.8rem;font-weight:700}

/* ---- sortable pages (drag to reorder header nav) ---- */
.grip{color:#9aa7b5}
.adm-table--sortable td.col-order,.adm-table--sortable th.col-order{width:1%;white-space:nowrap}
.adm-table--sortable td.col-order{display:flex;align-items:center;gap:.45rem}
.drag-handle{cursor:grab;color:#9aa7b5;font-size:1.15rem;line-height:1;user-select:none}
.drag-handle:active{cursor:grabbing}
.adm-table--sortable tbody tr.dragging{opacity:.55;background:var(--bg);box-shadow:0 3px 12px rgba(16,35,50,.18)}
.adm-table--sortable tbody tr[draggable="true"]{cursor:default}

/* ---- page editor ---- */
.row-ed{background:#fff;border:1px solid var(--line);border-radius:10px;padding:1rem;margin-bottom:1rem}
.row-head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:.5rem;margin-bottom:.75rem}
.row-label{font-weight:700;color:var(--brick);text-transform:uppercase;font-size:.8rem;letter-spacing:.04em}
.cols{display:grid;gap:.9rem}
.cols[data-n="2"]{grid-template-columns:1fr 1fr}
.cols[data-n="3"]{grid-template-columns:1fr 1fr 1fr}
.col-ed{background:var(--bg);border:1px dashed #c7ccd0;border-radius:8px;padding:.7rem}
.col-w{display:flex;align-items:center;gap:.4rem;margin-bottom:.6rem}
.col-w input{width:70px;padding:.3rem .45rem;border:1px solid var(--line);border-radius:5px;font:inherit}
.block-ed{background:#fff;border:1px solid var(--line);border-radius:7px;padding:.6rem .7rem;margin-bottom:.6rem}
.block-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}
.block-type{font-weight:700;font-size:.85rem;color:#444}
.block-body .fld{margin-bottom:.5rem}
.block-body input,.block-body textarea,.block-body select{width:100%;padding:.45rem .55rem;border:1px solid var(--line);border-radius:5px;font:inherit}
.blk-ctl{display:flex;gap:.25rem;align-items:center}
.add-block{display:flex;gap:.5rem;margin-top:.4rem}
.add-type{flex:0 0 auto;padding:.4rem;border:1px solid var(--line);border-radius:5px;font:inherit}
.subs{display:flex;flex-direction:column;gap:.5rem;margin-bottom:.4rem}
.sub{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap;background:var(--bg);padding:.5rem;border-radius:6px}
.sub input{flex:1 1 140px}
.sub-card{flex-direction:column;align-items:stretch}
.muted{color:#888;font-size:.9rem;margin:.2rem 0}
.row-add{display:flex;gap:.5rem;flex-wrap:wrap}
@media(max-width:760px){.cols[data-n="2"],.cols[data-n="3"]{grid-template-columns:1fr}}

/* ---- staff + settings ---- */
.flash{padding:.7rem 1rem;border-radius:7px;margin-bottom:1rem;font-weight:600}
.flash-ok{background:#e8f5e9;color:#236b27;border:1px solid #b6dab9}
.flash-err{background:#fde8e8;color:#8f0000;border:1px solid #f5c2c2}
.flash-pw{display:inline-block;background:#fff;border:1px solid #b6dab9;border-radius:5px;padding:.15rem .55rem;letter-spacing:.06em;font-weight:700}
.inline{display:inline}
.row-actions{display:flex;flex-wrap:wrap;gap:.3rem}
.btn-mini{background:#fff;border:1px solid var(--line);border-radius:5px;padding:.3rem .55rem;font:inherit;font-size:.8rem;cursor:pointer}
.btn-mini:hover{background:var(--bg)}
.btn-mini.danger{border-color:#e6b3b3;color:#b00}.btn-mini.danger:hover{background:#fde8e8}
.adm-table select{padding:.3rem;border:1px solid var(--line);border-radius:5px;font:inherit}
.ed-h2{margin-top:2rem;color:var(--brick)}
.add-staff{display:flex;gap:.75rem;align-items:flex-end;flex-wrap:wrap;background:#fff;border:1px solid var(--line);border-radius:8px;padding:1rem}
.add-staff .fld{flex:1 1 180px}
.add-staff input,.add-staff select{padding:.5rem;border:1px solid var(--line);border-radius:5px;font:inherit;width:100%}
.settings-form{display:grid;gap:1rem;max-width:680px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:1.25rem}
.settings-form input,.settings-form textarea,.settings-form select{padding:.55rem .65rem;border:1px solid var(--line);border-radius:6px;font:inherit;width:100%}
.fld-help{font-size:.8rem;color:#888;margin-top:.15rem}

/* ---- property manager (brand-header treatment) ---- */
.property{background:#fff;border:1px solid #c7d2dd;border-radius:11px;padding:1rem 1.1rem;margin-bottom:1.2rem;overflow:hidden;box-shadow:0 2px 8px rgba(16,35,50,.07)}
/* Blue header bar carrying status / visibility / move / delete — bleeds to the
   card edges via negative margins so it reads as a solid title strip. */
.prop-head{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap;
  margin:-1rem -1.1rem 1rem;padding:.7rem .95rem;
  background:linear-gradient(180deg,#3498db,#1e73be);color:#fff}
.prop-head .fld{flex:0 0 auto;min-width:120px;gap:.2rem}
.prop-head .fld-lbl{color:#dcecfa}
.prop-head select{border:0;border-radius:6px;padding:.45rem .6rem;font:inherit;font-weight:700;color:#155089;background:#fff}
.prop-head .fld-chk{color:#eaf3fb;font-weight:600}
.prop-head .fld-chk input{accent-color:#fff}
.prop-head .mv-btn{border:1px solid rgba(255,255,255,.55);background:rgba(255,255,255,.16);color:#fff}
.prop-head .mv-btn:hover{background:rgba(255,255,255,.3)}
.prop-head .del-btn{margin-left:auto;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.65);color:#fff}
.prop-head .del-btn:hover{background:rgba(0,0,0,.2)}
.property .fld-lbl{color:#2b6795}
.property .p-title{font-weight:600}
.property input,.property textarea{border:1px solid #9fb0bf;border-radius:6px;padding:.5rem .6rem;font:inherit;width:100%}
.property input:focus,.property textarea:focus,.prop-head select:focus{outline:none;border-color:#3498db;box-shadow:0 0 0 3px rgba(52,152,219,.22)}
.property .p-features{min-height:96px}
.prop-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.75rem;margin:.6rem 0}
.prop-images{display:flex;flex-direction:column;gap:.5rem;margin:.35rem 0 .6rem}
.prop-img{display:flex;gap:.6rem;align-items:center;background:#eef5fb;border:1px solid #d3e2f0;border-radius:8px;padding:.5rem}
.pi-preview{width:74px;height:56px;object-fit:cover;border-radius:5px;border:1px solid #c7d2dd;background:#fff;flex:0 0 auto}
.pi-fields{display:flex;flex-direction:column;gap:.35rem;flex:1 1 auto;min-width:0}
.pi-fields input{width:100%;padding:.4rem .55rem;border:1px solid #9fb0bf;border-radius:5px;font:inherit}
.property .btn-mini{border:1px solid #7fb4dd;color:#155089;font-weight:700}
.property .btn-mini:hover{background:#eef5fb}
.up-ctl{flex:0 0 auto}
.img-row{display:flex;gap:.5rem;align-items:center}
.img-row input{flex:1 1 auto}
#add-prop{background:var(--red);color:#fff;border:0;font-weight:700}
#add-prop:hover{background:var(--brick)}
@media(max-width:680px){.prop-grid{grid-template-columns:1fr}.prop-img{flex-wrap:wrap}}

/* ---- messages ---- */
.msg-list{display:flex;flex-direction:column;gap:.9rem}
.msg{background:#fff;border:1px solid var(--line);border-radius:10px;padding:1rem 1.15rem}
.msg--unread{border-left:4px solid var(--red)}
.msg-head{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;align-items:flex-start}
.msg-meta{font-size:.85rem;color:#667;margin-top:.2rem}
.msg-meta a{color:var(--red)}
.msg-subject{margin:.6rem 0 .2rem}
.msg-body{margin:.4rem 0 0;white-space:normal;color:#33434f}

/* ==========================================================================
   CAPTA intranet theme.
   Appended so it wins over the inherited rules above. Retunes the three legacy
   brand tokens to the CAPTA palette from the style guide, switches to the
   self-hosted Raleway, and adds the classes used by the intranet admin pages.
   ========================================================================== */
:root {
  --brick: #2D326A;   /* navy   — headings, auth backdrop */
  --red:   #2D326A;   /* navy   — links, primary buttons */
  --gold:  #F26E23;   /* orange — role badges, accents */
  --ink:   #1b1c2e;
  --line:  #EDECF1;
  --bg:    #FAF9F5;   /* cream */
  --navy:  #2D326A;
  --orange:#F26E23;
  --yellow:#F9C734;
  --danger:#b3261e;
  --font: 'Raleway', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
@font-face {
  font-family: 'Raleway';
  src: url('/assets/fonts/raleway-var.woff2') format('woff2-variations'),
       url('/assets/fonts/raleway-var.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
.auth { background: linear-gradient(135deg, var(--navy), #4a4f8f); }
.auth-brand { text-transform: none; letter-spacing: -.01em; }
.auth-btn { background: var(--orange); border-radius: 999px; }
.auth-btn:hover { background: #d95c14; }
.adm-main h1, .adm-card h2 { color: var(--navy); font-weight: 500; }
.adm-role { background: var(--orange); color: #fff; }
.adm-link { color: var(--navy); font-weight: 600; text-decoration: none; }
.adm-link:hover { color: var(--orange); text-decoration: underline; }

/* --- notices --- */
.adm-ok, .adm-err, .adm-warn {
  border-radius: 10px; padding: .8rem 1rem; margin: 0 0 1.1rem;
  border-left: 5px solid; font-size: .95rem;
}
.adm-ok   { background: #f0f7f0; border-color: #2e7d32; color: #1b5e20; }
.adm-err  { background: #fdf3f2; border-color: var(--danger); color: #8c1d18; }
.adm-warn { background: #fffaeb; border-color: var(--yellow); color: #4a3c00; }

/* --- forms / rows --- */
.adm-form {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.15rem; margin: 0 0 1.1rem;
}
.adm-row { border-left: 4px solid var(--line); }
.adm-row-head {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding-bottom: .6rem; margin-bottom: .8rem; border-bottom: 1px solid var(--line);
}
.adm-row-head code, .adm-row-head small { color: #666; font-size: .82rem; }
.adm-sub { background: var(--bg); margin-left: 1rem; }
.adm-grid {
  display: grid; gap: .3rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.adm-form label { display: block; font-size: .8rem; font-weight: 600; color: var(--navy); margin-bottom: .7rem; }
/* input[type=password] belongs in this list: without it the client-secret field on
   the Microsoft sign-in page rendered at its unstyled default width, next to a
   full-width field, which read as a broken form. */
.adm-form input[type=text], .adm-form input[type=url], .adm-form input[type=email],
.adm-form input[type=number], .adm-form input[type=password],
.adm-form input:not([type]), .adm-form select, .adm-form textarea {
  display: block; width: 100%; margin-top: .25rem; font: inherit; font-size: .92rem;
  font-weight: 400; color: var(--ink); padding: .45em .65em;
  border: 1px solid #cfd3e0; border-radius: 8px; background: #fff;
}
.adm-form textarea { line-height: 1.55; resize: vertical; }
.adm-form input:focus, .adm-form select:focus, .adm-form textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(45,50,106,.12);
}
.adm-chk { display: flex; align-items: center; gap: .4rem; margin-top: 1.4rem; }
.adm-chk input { width: auto; margin: 0; }
.adm-hint { font-size: .8rem; color: #777; margin: -.3rem 0 .8rem; }

/* --- buttons --- */
.adm-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.adm-actions button, .adm-form > button, .adm-inline button {
  font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
  padding: .45em 1em; border-radius: 999px;
  border: 1px solid var(--navy); background: var(--navy); color: #fff;
}
.adm-actions button:hover, .adm-form > button:hover, .adm-inline button:hover { background: #232755; }
.adm-danger { background: #fff !important; color: var(--danger) !important; border-color: #e6c9c6 !important; }
.adm-danger:hover { background: #fdf3f2 !important; border-color: var(--danger) !important; }
.btn-primary { background: var(--orange); border-color: var(--orange); border-radius: 999px; }
.btn-primary:hover { background: #d95c14; }

/* --- inline forms, lists, crumbs --- */
.adm-inline { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: 0; }
.adm-inline label { margin: 0; font-size: .8rem; }
.adm-inline input, .adm-inline select { margin: 0 !important; width: auto !important; }
.adm-list { list-style: none; margin: .8rem 0; padding: 0; }
.adm-list li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.adm-list a { font-weight: 600; color: var(--navy); text-decoration: none; }
.adm-list a:hover { color: var(--orange); text-decoration: underline; }
.adm-list small { display: block; color: #888; font-size: .78rem; }
.adm-crumbs { margin: 1rem 0; font-size: .88rem; }
.adm-crumbs a { color: var(--navy); }
.adm-crumbs a.is-on { font-weight: 700; text-decoration: underline; }

/* --- tables --- */
.adm-table { width: 100%; border-collapse: collapse; background: #fff; font-size: .9rem; margin: 1rem 0; }
.adm-table th, .adm-table td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm-table thead th { background: var(--bg); color: var(--navy); font-weight: 700; font-size: .8rem; }
.adm-table tr.is-off { opacity: .55; }
.adm-table small { color: #777; }
.adm-table td form { margin: 0; }

/* --- badges --- */
.pill-yes, .pill-draft {
  display: inline-block; border-radius: 999px; padding: .1em .6em;
  font-size: .72rem; font-weight: 700;
}
.pill-yes   { background: var(--orange); color: #fff; }
.pill-draft { background: var(--line); color: var(--navy); }

@media (max-width: 700px) {
  .adm-table, .adm-table thead, .adm-table tbody, .adm-table tr, .adm-table th, .adm-table td { display: block; }
  .adm-table thead { display: none; }
  .adm-table tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: .8rem; padding: .5rem; }
  .adm-table td { border: 0; padding: .35rem .5rem; }
}

/* ------------------------------------------------------- super admin tier ---- */
.pill-super {
  display: inline-block; border-radius: 999px; padding: .1em .6em;
  font-size: .72rem; font-weight: 700; background: #111; color: #fff;
}
.adm-locked { font-size: .8rem; color: var(--muted, #888); font-style: italic; }
.adm-nav { display: flex; gap: .9rem; font-size: .84rem; margin-left: 1.25rem; }
.adm-nav a { color: rgba(255,255,255,.85); text-decoration: none; font-weight: 600; }
.adm-nav a:hover { color: #fff; text-decoration: underline; }
@media (max-width: 700px) { .adm-nav { width: 100%; margin: .4rem 0 0; flex-wrap: wrap; } }

/* ============================================================================
   Microsoft sign-in setup panel (Settings -> Microsoft sign-in)
   A setup screen that is followed once, under pressure, by someone who is not a
   developer — so it is laid out as numbered steps with an obvious current step,
   and check results are colour AND glyph coded (colour alone fails for anyone
   who cannot distinguish red from green).
   ========================================================================== */
.ms-progress { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0 1.6rem; padding: 0; }
.ms-progress li {
  flex: 1 1 14rem; display: flex; align-items: center; gap: .6rem;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .9rem; font-size: .88rem; font-weight: 600; color: #8b8fa3;
}
.ms-num {
  flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--line); color: #6b7086; font-size: .82rem; font-weight: 700;
}
.ms-progress li.is-now { border-color: var(--orange); color: var(--ink); }
.ms-progress li.is-now .ms-num { background: var(--orange); color: #fff; }
.ms-progress li.is-done { border-color: #2e7d32; color: var(--ink); }
.ms-progress li.is-done .ms-num { background: #2e7d32; color: #fff; }

.ms-step {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 1.1rem 1.15rem; margin: 0 0 1.1rem;
}
/* The panel sits under Settings, so its step headings are h3 (h2 belongs to the
   page section). Match both so the panel renders the same wherever it is used. */
.ms-step > h2, .ms-step > h3 { display: flex; align-items: center; gap: .55rem; margin: 0 0 .5rem; font-size: 1.1rem; color: var(--navy); }
.ms-step-n {
  flex: 0 0 1.55rem; height: 1.55rem; border-radius: 50%; background: var(--navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700;
}
.ms-h3 { margin: 1.4rem 0 .3rem; font-size: .95rem; color: var(--navy); }
/* Anchored jumps from the Settings sub-nav must not hide the heading under nothing. */
#site, #microsoft, #system { scroll-margin-top: 1rem; }
.ms-search { margin: .6rem 0 1rem; }

/* copyable values */
.ms-copytext { display: inline-block; background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: .2rem .45rem; font-size: .84rem; word-break: break-all; }
.ms-copy {
  font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; margin-left: .4rem;
  padding: .22em .7em; border-radius: 999px; border: 1px solid var(--navy);
  background: #fff; color: var(--navy); vertical-align: middle;
}
.ms-copy:hover { background: var(--navy); color: #fff; }
.ms-copy.is-copied { background: #2e7d32; border-color: #2e7d32; color: #fff; }

/* check results */
.ms-checks { list-style: none; margin: .9rem 0; padding: 0; display: grid; gap: .5rem; }
.ms-checks li {
  display: flex; align-items: flex-start; gap: .65rem;
  border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px;
  padding: .6rem .8rem; font-size: .9rem; background: #fff;
}
.ms-checks small { color: #666; }
.ms-mark {
  flex: 0 0 1.35rem; height: 1.35rem; border-radius: 50%; margin-top: .05rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff; background: #9aa0b4;
}
.ms-checks li.ms-ok   { border-left-color: #2e7d32; }
.ms-checks li.ms-ok   .ms-mark { background: #2e7d32; }
.ms-checks li.ms-fail { border-left-color: var(--danger); background: #fdf3f2; }
.ms-checks li.ms-fail .ms-mark { background: var(--danger); }
.ms-checks li.ms-warn { border-left-color: var(--yellow); background: #fffaeb; }
.ms-checks li.ms-warn .ms-mark { background: #b8860b; }
.ms-checks li.ms-todo { border-left-color: #9aa0b4; }

@media (max-width: 640px) {
  .ms-progress li { flex: 1 1 100%; }
  .ms-copy { margin: .35rem 0 0; display: inline-block; }
}

/* The group search is an .adm-inline form, where inputs are width:auto so buttons sit
   beside them — but auto is far too narrow for typing a group name into. */
.ms-search input[name=q] { min-width: 16rem; }
/* .adm-inline sets width:auto !important so fields sit beside their button; on a phone
   that leaves the search box too narrow to read a group name in, so override it. */
@media (max-width: 480px) {
  .ms-search label { flex: 1 1 100%; }
  .ms-search input[name=q] { min-width: 0; width: 100% !important; }
}

/* A group already mapped to a role renders its button disabled; without a style for
   that it looked identical to a live button, i.e. like a click that did nothing. */
.adm-inline button[disabled], .adm-actions button[disabled] {
  background: #fff; color: #9aa0b4; border-color: var(--line); cursor: default;
}
.adm-inline button[disabled]:hover, .adm-actions button[disabled]:hover { background: #fff; }

/* Fresh-install nudge: sits directly under the admin bar, full-bleed so it reads as
   a site-level state rather than one page's message. */
.adm-banner {
  background: #fffaeb; border-bottom: 1px solid var(--yellow);
  color: #4a3c00; font-size: .88rem; padding: .6rem 1.2rem; text-align: center;
}
.adm-banner a { color: var(--navy); font-weight: 700; }

/* Site details, the Microsoft panel and System now sit on one page. The settings
   form's 680px cap was fine alone but reads as ragged beside full-width panels, so
   let it fill the column like everything else on the page. */
.adm-main .settings-form { max-width: none; }
