/* AkiraField-specific styles. The design system (layout, tables, buttons, forms, modals, grid toolbar,
   pager, row actions, page header, empty state) is AkiraSC's css/akira.css on top of Bootstrap 5.3 dark,
   loaded before this file. Only what AkiraSC does not have goes here. */

/* Blazor focuses the page <h1> after navigation (FocusOnNavigate, for screen readers): no visible box. */
h1:focus, h1:focus-visible { outline: none; }

/* ---- layout additions ---- */
.sidebar-tenant { padding: 10px 16px 0; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.akira-header .header-user-menu > summary { list-style: none; }
.akira-header .header-user-menu > summary::-webkit-details-marker { display: none; }
.akira-header .header-user-dropdown .small { font-size: 12px; color: var(--text-muted); }
.akira-header form { margin: 0; }

/* support mode: Sumato acting inside a tenant */
.support-bar { display: flex; align-items: center; gap: .6rem; padding: .35rem .75rem; border-radius: var(--ak-radius-md); background: rgba(245,158,11,.14); color: var(--warning); font-size: 13px; }
.support-bar form { margin: 0; }
.support-exit { padding: .2rem .6rem; font-size: 12px; border: 1px solid rgba(245,158,11,.4); border-radius: var(--ak-radius-sm); background: transparent; color: var(--warning); }
.support-exit:hover { background: rgba(245,158,11,.14); }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: .6rem 1rem; background: var(--warning); color: #1a1a1a; z-index: 9999; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* ---- small helpers used by AkiraField pages ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0; }
.home-card { display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--ak-radius-md); color: inherit; text-decoration: none; }
.home-card:hover { border-color: var(--accent); color: inherit; }
.home-card i { color: var(--accent); font-size: 1.2rem; margin-bottom: .3rem; }
.home-card span { color: var(--text-muted); font-size: 13px; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--ak-radius-md); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.panel h2 { font-size: 1rem; font-weight: 600; margin-bottom: .4rem; }
.toggle-row { display: flex; align-items: flex-start; gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--border); margin: 0; cursor: pointer; }
.toggle-row span { display: flex; flex-direction: column; gap: .15rem; }
.toggle-row input { margin-top: .25rem; }
pre.audit-json { white-space: pre-wrap; font-size: .78rem; margin: .25rem 0; color: var(--text-secondary); }

/* ---- maps: dark look like AkiraSC — filter ONLY the tile pane, never markers/popups ---- */
.af-map { height: 420px; border: 1px solid var(--border); border-radius: var(--ak-radius-md); overflow: hidden; background: #0f1115; }
/* Only for light rasters (plain OSM fallback): the dark-matter style is already dark. Never on markers. */
.af-map.af-map-invert .leaflet-tile-pane { filter: invert(90%) hue-rotate(180deg) brightness(0.95) contrast(0.9) saturate(0.4); }
.af-map .leaflet-control-attribution { background: rgba(23,25,30,.8); color: var(--text-muted); }
.af-map .leaflet-control-attribution a { color: var(--text-secondary); }
.af-pin { background: none; border: 0; }

/* customers / site editor */
.site-editor { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 1.25rem; align-items: start; }
.site-editor .af-map { height: 560px; }
.geo-results { list-style: none; margin: -.25rem 0 .9rem; padding: .3rem; border: 1px solid var(--border); border-radius: var(--ak-radius-sm); background: var(--ak-surface-sunken); max-height: 180px; overflow: auto; }
.geo-results li button { text-align: left; font-size: 12px; }
.coords { font-size: 12px; font-family: ui-monospace, monospace; }
@media (max-width: 900px) { .site-editor { grid-template-columns: 1fr; } }

/* catalogs */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; vertical-align: middle; }

/* ---- auth: dark login, same look as AkiraSC ---- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--bg-primary); }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--ak-radius-lg); padding: 2rem 2.25rem; }
.login-head { text-align: center; margin-bottom: 1.5rem; }
.login-logo svg { width: 46px; height: 46px; fill: var(--accent); }
.login-head h1 { font-size: 1.6rem; font-weight: 700; margin: .4rem 0 .1rem; letter-spacing: .02em; }
.login-head p { margin: 0; color: var(--text-muted); font-size: .9rem; }
.login-alert { display: flex; gap: .5rem; align-items: flex-start; padding: .65rem .8rem; border-radius: var(--ak-radius-md); margin-bottom: 1rem; background: rgba(239,68,68,.12); color: #fca5a5; font-size: .9rem; }
.login-alert svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; margin-top: .1rem; }
.login-alert small { opacity: .7; }
.login-sso { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; padding: .7rem 1rem; margin-bottom: .6rem; background: #2b3038; border: 1px solid var(--border); border-radius: var(--ak-radius-md); color: var(--text-primary); text-decoration: none; font-weight: 600; }
.login-sso:hover { background: #333944; color: var(--text-primary); }
.ms-logo { width: 18px; height: 18px; }
.login-divider { display: flex; align-items: center; gap: .75rem; color: var(--text-muted); font-size: .85rem; margin: 1.25rem 0; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.login-form label { display: block; margin: 0 0 .35rem; font-size: .9rem; color: var(--text-primary); }
.login-input { display: flex; align-items: stretch; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: var(--ak-radius-md); background: var(--ak-surface-input-dark); overflow: hidden; }
.login-input:focus-within { border-color: var(--accent); }
.login-input input, .login-input select { flex: 1; min-width: 0; border: 0; border-radius: 0; background: transparent; color: var(--text-primary); padding: .7rem .75rem; outline: none; }
.login-input select option { background: var(--bg-card); }
.login-icon, .login-eye { display: grid; place-items: center; width: 46px; flex-shrink: 0; background: transparent; border: 0; border-radius: 0; padding: 0; }
.login-icon { border-right: 1px solid var(--border); }
.login-eye { border-left: 1px solid var(--border); cursor: pointer; }
.login-icon svg, .login-eye svg { width: 18px; height: 18px; fill: var(--text-muted); }
.login-eye[aria-pressed="true"] svg { fill: var(--accent); }
.login-submit { width: 100%; margin-top: .5rem; padding: .75rem; border: 0; border-radius: var(--ak-radius-md); background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.login-submit:hover { background: var(--accent-hover); }
.login-back { text-align: center; margin: 1.25rem 0 0; font-size: .9rem; }
.login-back a { color: var(--text-muted); }

/* technicians */
.check-list { max-height: 170px; overflow: auto; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: var(--ak-radius-sm); background: var(--ak-surface-sunken); }


/* tickets */
.ticket-timeline { list-style: none; padding: 0; margin: 0; }
.ticket-timeline li { display: flex; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.ticket-timeline li:last-child { border-bottom: 0; }
.ticket-timeline li > i { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-hover); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; font-size: 12px; }


/* Live map (F4b): list on the left, map filling the rest of the screen. */
.live-map-canvas { height: calc(100vh - 230px); min-height: 420px; }
.live-list { max-height: calc(100vh - 330px); min-height: 300px; overflow-y: auto; }
.live-item { display: flex; gap: .5rem; align-items: flex-start; padding: .4rem .5rem; border-radius: var(--ak-radius-md); cursor: pointer; }
.live-item:hover { background: rgba(255,255,255,.04); }
.live-item.active { background: rgba(59,130,246,.15); }
.live-item .swatch { width: 10px; height: 10px; border-radius: 50%; margin-top: .4rem; flex-shrink: 0; }

/* Map tooltips: dark like AkiraSC's map popups (.akira-cluster-popup); markers carry no text, details live here. */
.leaflet-tooltip.af-tip { background: #1c1f26; color: #fff; border: 1px solid rgba(255,255,255,.12); border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,.5); padding: .45rem .6rem; font-size: .8rem; line-height: 1.35; white-space: nowrap; }
.leaflet-tooltip.af-tip::before { border-top-color: #1c1f26; }
.af-tip .tip-title { font-weight: 600; font-size: .85rem; }
.af-tip .tip-muted { color: #9aa4b2; }
.af-tip .tip-badge { display: inline-block; padding: 0 .35rem; border-radius: 4px; font-size: .7rem; margin-left: .25rem; color: #fff; }
.live-legend { display: flex; gap: .9rem; align-items: center; font-size: .75rem; color: var(--text-muted); }
.live-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; }
.live-legend .sq { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; }

/* Home dashboard: copied from AkiraSC's client dashboard (Pages/Index.razor, cd-*), plus links and health states. */
.client-dashboard { max-width: 1180px; margin: 0 auto; padding: 4px 2px 40px; }
.cd-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom: 22px; }
.cd-title { font-size: 1.9rem; font-weight: 800; color:#f4f8ff; margin:0; letter-spacing:-.01em; }
.cd-subtitle { color:#8ea0bd; font-size:.95rem; margin-top:2px; }
.cd-loading, .cd-empty { color:#8ea0bd; padding: 24px 4px; }
.cd-kpis { display:grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap:14px; margin-bottom: 20px; }
.cd-kpi { background:#1a2334; border:1px solid #2b3853; border-radius:12px; padding:18px 18px 14px; color:inherit; text-decoration:none; display:block; }
.cd-kpi-link:hover { border-color:#3b4b6b; }
.cd-kpi-accent { border-color:#2dd4bf55; box-shadow: inset 0 0 0 1px #2dd4bf22; }
.cd-kpi-warn { border-color:#f59e0b77; box-shadow: inset 0 0 0 1px #f59e0b33; }
.cd-kpi-label { color:#8ea0bd; font-size:.8rem; text-transform:uppercase; letter-spacing:.06em; }
.cd-kpi-value { font-size: 2.15rem; font-weight: 800; color:#f4f8ff; line-height:1.15; margin-top:6px; }
.cd-kpi-of { font-size:1.15rem; font-weight:600; color:#8ea0bd; }
.cd-kpi-foot { color:#7a8aa6; font-size:.8rem; margin-top:4px; }
.cd-charts { display:grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap:14px; margin-bottom:16px; }
.cd-lower { display:grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap:14px; }
.cd-card { background:#1a2334; border:1px solid #2b3853; border-radius:12px; padding:16px 18px; }
.cd-card-title { color:#dfe8f8; font-weight:600; font-size:.95rem; margin-bottom:12px; display:flex; align-items:center; gap:10px; }
.cd-legend { margin-left:auto; color:#8ea0bd; font-size:.75rem; font-weight:400; }
.cd-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin:0 4px 0 10px; }
.cd-spark { width:100%; height:120px; display:block; }
.cd-spark-foot { display:flex; justify-content:space-between; color:#7a8aa6; font-size:.72rem; margin-top:4px; }
.cd-bars { display:flex; flex-direction:column; gap:10px; }
.cd-bar-row { display:grid; grid-template-columns: 140px 1fr 56px; align-items:center; gap:10px; color:inherit; text-decoration:none; }
.cd-bar-name { color:#c4d0e6; font-size:.85rem; }
.cd-bar-track { background:#2a364a; border-radius:5px; height:14px; overflow:hidden; }
.cd-bar-fill { background:#2dd4bf; height:100%; border-radius:5px; min-width:3px; }
.cd-bar-val { color:#d8e3f7; font-weight:600; font-size:.85rem; text-align:right; }
.cd-recent { display:flex; flex-direction:column; }
.cd-recent-row { display:flex; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid #232f44; font-size:.88rem; color:inherit; text-decoration:none; }
a.cd-recent-row:hover .cd-recent-type { text-decoration: underline; }
.cd-recent-row:last-child { border-bottom:none; }
.cd-sev { width:9px; height:9px; border-radius:50%; flex:0 0 auto; }
.cd-sev-crit { background:#ef4444; } .cd-sev-warn { background:#f59e0b; } .cd-sev-info { background:#38bdf8; } .cd-sev-ok { background:#22c55e; }
.cd-recent-type { color:#eaf1ff; font-weight:600; }
.cd-recent-time { color:#7a8aa6; margin-left:auto; white-space:nowrap; }
.cd-updated { color:#6b7a96; font-size:.78rem; margin-top:18px; text-align:right; }

/* Live indicator of the map: icon only, tooltip explains it. */
.live-state { display:inline-flex; align-items:center; justify-content:center; width:2.1rem; height:2.1rem; border-radius:50%; font-size:1rem; }
.live-state.live-on { color:#22c55e; background:rgba(34,197,94,.12); }
.live-state.live-off { color:#94a3b8; background:rgba(148,163,184,.12); }
.live-state .fa-stack { width:1.2em; height:1em; line-height:1em; }
