/* ==========================================================================
   Admin (admin.riversync.com) — page-specific styles
   Layered on riversync-ui.css (the rs-* kit). Tokens only — var(--*).
   Only what the shared kit doesn't already provide.
   ========================================================================== */

/* KPI strip — reuses rs-stat semantics in a responsive grid */
.ad-kpis{display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:22px;}
@media (max-width:1100px){ .ad-kpis{grid-template-columns:repeat(2,1fr);} }
.ad-kpis .rs-stat{padding:15px 17px;}
.ad-kpis .rs-stat__value{font-size:25px;}

/* generic two-column page split */
.ad-split{display:grid; grid-template-columns:1fr 340px; gap:20px; align-items:start;}
@media (max-width:1080px){ .ad-split{grid-template-columns:1fr;} }

/* org cell in tables (avatar + name + domain) */
.ad-org{display:flex; align-items:center; gap:11px; min-width:0;}
.ad-org__meta{display:flex; flex-direction:column; min-width:0;}
.ad-org__meta b{font-weight:600; color:var(--fg); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.ad-org__meta span{font-size:11.5px; color:var(--fg3); font-family:var(--rs-font-mono,monospace);}
.rs-table td .num{font-variant-numeric:tabular-nums;}
.rs-table tr[data-href]{cursor:pointer;}
.rs-table tr[data-href]:hover{background:var(--surface-2);}
.rs-table tr.is-suspended td:not(.col-actions){opacity:.62;}

/* status dot used in health + provisioning */
.ad-dot{display:inline-block; width:9px; height:9px; border-radius:50%; flex:none;}
.ad-dot--operational,.ad-dot--ok{background:var(--success);}
.ad-dot--degraded{background:var(--warning);}
.ad-dot--down{background:var(--danger);}

/* service health cards */
.ad-health{display:grid; grid-template-columns:repeat(2,1fr); gap:14px;}
@media (max-width:820px){ .ad-health{grid-template-columns:1fr;} }
.ad-svc{display:flex; gap:12px; padding:15px 16px; border:1px solid var(--border); border-radius:var(--r-lg); background:var(--surface); box-shadow:var(--shadow-sm);}
.ad-svc__led{margin-top:5px;}
.ad-svc__b{flex:1 1 auto; min-width:0;}
.ad-svc__t{display:flex; align-items:center; gap:8px; justify-content:space-between;}
.ad-svc__t b{font-size:13.5px; font-weight:600; color:var(--fg);}
.ad-svc__dom{font-size:11.5px; color:var(--fg3); font-family:var(--rs-font-mono,monospace); margin-top:1px;}
.ad-svc__blurb{font-size:12px; color:var(--fg2); line-height:1.45; margin-top:7px;}
.ad-svc__metrics{display:flex; gap:16px; margin-top:9px; font-size:11.5px; color:var(--fg3);}
.ad-svc__metrics b{color:var(--fg); font-variant-numeric:tabular-nums; font-weight:600;}

/* incident / audit timeline */
.ad-feed{display:flex; flex-direction:column;}
.ad-feed__item{display:flex; gap:12px; padding:13px 0; border-bottom:1px solid var(--border);}
.ad-feed__item:last-child{border-bottom:0;}
.ad-feed__ic{flex:none; width:30px; height:30px; border-radius:7px; display:flex; align-items:center; justify-content:center; background:var(--surface-3); color:var(--fg2);}
.ad-feed__ic .rs-ic{width:16px; height:16px;}
.ad-feed__ic--accent{background:var(--accent-soft); color:var(--accent);}
.ad-feed__ic--success{background:var(--success-soft); color:var(--success);}
.ad-feed__ic--warning{background:var(--warning-soft); color:var(--warning);}
.ad-feed__ic--danger{background:var(--danger-soft); color:var(--danger);}
.ad-feed__ic--info{background:var(--info-soft); color:var(--info);}
.ad-feed__b{flex:1 1 auto; min-width:0;}
.ad-feed__b b{font-size:13px; font-weight:600; color:var(--fg);}
.ad-feed__b p{font-size:12px; color:var(--fg2); line-height:1.45; margin:3px 0 0;}
.ad-feed__meta{font-size:11px; color:var(--fg3); font-family:var(--rs-font-mono,monospace); margin-top:4px; display:flex; gap:8px; flex-wrap:wrap;}

/* plan cards */
.ad-plans{display:grid; grid-template-columns:repeat(3,1fr); gap:16px;}
@media (max-width:1100px){ .ad-plans{grid-template-columns:repeat(2,1fr);} }
@media (max-width:680px){ .ad-plans{grid-template-columns:1fr;} }
.ad-plan{display:flex; flex-direction:column; border:1px solid var(--border); border-radius:var(--r-lg); background:var(--surface); box-shadow:var(--shadow-sm); overflow:hidden;}
.ad-plan__head{padding:16px 18px 14px; border-bottom:1px solid var(--border);}
.ad-plan__name{font-size:15px; font-weight:600; color:var(--fg); display:flex; align-items:center; gap:8px;}
.ad-plan__price{margin-top:9px; font-size:24px; font-weight:600; color:var(--fg); letter-spacing:-.02em; font-variant-numeric:tabular-nums;}
.ad-plan__price small{font-size:12.5px; font-weight:500; color:var(--fg3);}
.ad-plan__blurb{font-size:12px; color:var(--fg2); line-height:1.5; padding:13px 18px; border-bottom:1px solid var(--border);}
.ad-plan__feat{list-style:none; margin:0; padding:13px 18px; display:flex; flex-direction:column; gap:8px; flex:1 1 auto;}
.ad-plan__feat li{display:flex; gap:8px; align-items:flex-start; font-size:12.5px; color:var(--fg);}
.ad-plan__feat li .rs-ic{width:15px; height:15px; color:var(--success); flex:none; margin-top:1px;}
.ad-plan__foot{padding:12px 18px; border-top:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:10px; background:var(--surface-2);}
.ad-plan__foot span{font-size:12px; color:var(--fg3);}
.ad-plan__foot b{color:var(--fg); font-variant-numeric:tabular-nums;}

/* provisioning stage rail */
.ad-stage{display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600;}
.ad-stage .ad-dot{width:8px; height:8px;}
.ad-stage--ready{color:var(--accent);} .ad-stage--ready .ad-dot{background:var(--accent);}
.ad-stage--scheduled{color:var(--maintenance,#7363A3);} .ad-stage--scheduled .ad-dot{background:var(--maintenance,#7363A3);}
.ad-stage--commissioning{color:var(--warning);} .ad-stage--commissioning .ad-dot{background:var(--warning);}
.ad-stage--done{color:var(--success);} .ad-stage--done .ad-dot{background:var(--success);}

/* detail page header */
.ad-detailhead{display:flex; align-items:flex-start; gap:16px; margin-bottom:20px;}
.ad-detailhead .rs-av{--s:52px; flex:none;}
.ad-detailhead__meta{flex:1 1 auto; min-width:0;}
.ad-detailhead__meta h1{font-size:22px; font-weight:600; letter-spacing:-.01em; line-height:1.15;}
.ad-detailhead__sub{display:flex; align-items:center; gap:10px; margin-top:7px; flex-wrap:wrap; font-size:12.5px; color:var(--fg3);}
.ad-detailhead__sub .mono{font-family:var(--rs-font-mono,monospace);}
.ad-detailhead__actions{display:flex; gap:8px; flex:none;}

/* fact grid (detail page) */
.ad-facts{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:1px; background:var(--border); border:1px solid var(--border); border-radius:var(--r-lg); overflow:hidden;}
.ad-fact{background:var(--surface); padding:13px 16px;}
.ad-fact__l{font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--fg3);}
.ad-fact__v{font-size:15px; font-weight:600; color:var(--fg); margin-top:5px; font-variant-numeric:tabular-nums;}

/* matrix table cell tone */
.ad-grant{display:inline-flex; align-items:center; justify-content:center; min-width:54px; height:22px; padding:0 9px; border-radius:2px; font-size:11px; font-weight:700; letter-spacing:.03em;}
.ad-grant--full{background:var(--success-soft); color:var(--success);}
.ad-grant--read{background:var(--info-soft); color:var(--info);}
.ad-grant--none{background:transparent; color:var(--fg3);}

/* read-only banner when a non-admin role views a mutating surface */
.ad-readonly{display:flex; align-items:center; gap:10px; padding:9px 14px; border:1px solid var(--info-border); background:var(--info-soft); color:var(--info); border-radius:var(--r-md); font-size:12.5px; margin-bottom:16px;}
.ad-readonly .rs-ic{width:16px; height:16px; flex:none;}

/* section label spacing */
.ad-seclbl{margin:26px 0 12px;}
