/* Signed-in account dashboard (account page only; the admin console never loads this file).
   Idea: a survey map sheet. The header is the sheet collar: the account sits inside a double neatline with its
   code written on the frame like a sheet number; plans are the legend. Meters are map scale bars.
   Colours come from app.css tokens, so light and dark follow prefers-color-scheme. */

.ac-top { position: relative; overflow: hidden; isolation: isolate; background: var(--deep); color: var(--side-ink); }
.ac-top .topo { z-index: -1; }
.ac-bar { max-width: 1180px; margin: 0 auto; padding: .9rem 16px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.ac-top a.site { color: var(--side-ink); font-size: .88rem; display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; padding: .35rem .6rem; border-radius: 6px; border: 1px solid var(--side-line); }
.ac-top a.site:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.ac-top a.site .ico { width: 15px; height: 15px; }
.ac-top button.site.link { color: var(--side-ink); text-decoration-color: rgba(227, 236, 236, .4); }
.ac-top button.site.link:hover { color: #fff; }

.ac-collar { max-width: 1180px; margin: 0 auto; padding: 1rem 16px 2rem; }
.ac-sheet {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.25rem 2.5rem;
    padding: 1.6rem 1.6rem 1.4rem;
    border: 1px solid rgba(214, 166, 114, .55);
    box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--deep) 70%, transparent), inset 0 0 0 5px rgba(214, 166, 114, .28);
    background: color-mix(in srgb, var(--deep) 72%, transparent);
}
.ac-sheet-no { position: absolute; top: 0; left: 1.1rem; transform: translateY(-50%); display: inline-flex; align-items: center; gap: .35rem; padding: 0 .55rem; background: var(--deep); color: var(--topo); font-size: .8rem; line-height: 1.6; }
.ac-sheet-no b { color: #fff; font-weight: 600; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.ac-copy { min-height: 0; padding: .15rem; border: 0; background: none; color: var(--topo); border-radius: 4px; }
.ac-copy:hover { color: #fff; border: 0; background: rgba(255, 255, 255, .08); }
.ac-copy .ico { width: 14px; height: 14px; }
.ac-copy:focus-visible { outline-color: var(--topo); }

.ac-who { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.ac-avatar { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(214, 166, 114, .5); color: var(--topo); font-weight: 600; font-size: 1.35rem; background: var(--deep-2); }
.ac-who-t { min-width: 0; }
.ac-who h1 { color: #fff; font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.ac-who p { margin: .2rem 0 0; color: var(--side-muted); font-size: .88rem; }

.ac-legend { display: flex; margin: 0; padding: 0; list-style: none; }
.ac-legend li { display: flex; flex-direction: column; gap: .1rem; padding: .1rem 1.4rem; min-width: 0; }
.ac-legend li + li { border-left: 1px solid rgba(214, 166, 114, .3); }
.ac-legend li:last-child { padding-right: 0; }
.ac-legend-p { font-size: .8rem; color: var(--side-muted); }
.ac-legend-t { display: inline-flex; align-items: center; gap: .5rem; color: #fff; font-size: 1.15rem; font-weight: 600; white-space: nowrap; }
.ac-legend-t .sw { width: 11px; height: 11px; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.ac-legend-e { font-size: .82rem; color: var(--side-muted); }
.ac-legend li.soon .ac-legend-e { color: var(--topo); }

/* ------------------------------------------------------------------ body: side nav + column */
.ac-body { max-width: 1180px; margin: 0 auto; padding: 1.75rem 16px 3rem; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2.25rem; align-items: start; }
.ac-nav { position: sticky; top: 1rem; }
.ac-nav ul { margin: 0; padding: 0; list-style: none; }
.ac-nav a, .ac-nav-out { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .7rem; margin: 1px 0; border-radius: 7px; color: var(--ink-2); text-decoration: none; font-size: .93rem; font-weight: 500; }
.ac-nav a .ico, .ac-nav-out .ico { color: var(--muted); }
.ac-nav a:hover { background: var(--panel-2); color: var(--ink); }
.ac-nav a[aria-current="page"] { background: var(--forest-soft); color: var(--forest); font-weight: 600; box-shadow: inset 2px 0 0 var(--forest); }
.ac-nav a[aria-current="page"] .ico { color: var(--forest); }
.ac-nav a span { flex: 1; min-width: 0; }
.ac-count { font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); padding: 0 .4rem; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); }
.ac-nav-out { justify-content: flex-start; border: 0; background: none; min-height: 0; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line-2); border-radius: 0; color: var(--muted); }
.ac-nav-out:hover { color: var(--bad); border-color: var(--line-2); }

.ac-col { min-width: 0; }
.ac-main { min-width: 0; outline: none; }
.ac-foot { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line-2); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; }
.ac-foot .foot-links { margin: 0; justify-content: flex-start; }
.ac-foot .signature { margin: 0; }

/* ------------------------------------------------------------------ section heads, panels */
.ac-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; margin: 0 0 1.25rem; }
.ac-head h2 { margin: 0; font-size: 1.55rem; letter-spacing: -.02em; }
.ac-head p { margin: .35rem 0 0; color: var(--muted); max-width: 68ch; font-size: .93rem; }
.ac-back { margin: 0 0 .75rem -.5rem; color: var(--muted); }
.ac-head .ac-back { margin: 0; flex-basis: 100%; justify-content: flex-start; width: max-content; }

.ac-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.3rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); min-width: 0; }
.ac-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: 0 0 .85rem; }
.ac-panel-head h3 { margin: 0; font-size: 1rem; }
.ac-panel h4 { margin: 1rem 0 .5rem; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.ac-panel > .notice:last-child { margin-bottom: 0; }
.ac-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.ac-grid > .ac-panel { margin-bottom: 0; height: 100%; }
.ac-grid + .ac-panel { margin-top: 1rem; }
.ac-later:empty { display: none; }
.ac-soon { color: var(--ochre); font-weight: 500; }
.btn.sm { min-height: 32px; padding: .3rem .65rem; font-size: .84rem; }

/* scale bar meter */
.ac-scale { margin: .2rem 0 .3rem; }
.ac-scale-text { font-size: .86rem; color: var(--ink-2); margin-bottom: .35rem; font-variant-numeric: tabular-nums; }
.ac-scale-track { position: relative; height: 10px; border: 1px solid var(--ink-2); background: var(--panel); overflow: hidden; }
.ac-scale-track > i { position: absolute; inset: 0 auto 0 0; background: var(--forest); }
.ac-scale-track::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--ink-2) 1px, transparent 1px) 0 0 / 10% 100%; opacity: .55; }
.ac-scale-track::before { content: ""; position: absolute; z-index: 1; inset: 0 0 50% 0; background: linear-gradient(90deg, transparent 50%, color-mix(in srgb, var(--ink-2) 18%, transparent) 50%) 0 0 / 20% 100%; }
.ac-scale.warn .ac-scale-track > i { background: var(--ochre); }
.ac-scale-ticks { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); margin-top: .2rem; font-variant-numeric: tabular-nums; }

/* overview: plan rows */
.ac-prows { list-style: none; margin: 0 0 .5rem; padding: 0; }
.ac-prows li { padding: .2rem 0 .9rem; }
.ac-prows li + li { border-top: 1px solid var(--line-2); padding-top: .9rem; }
.ac-prow-name { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.ac-prow-name b { font-size: 1.02rem; font-weight: 600; }
.ac-prows .small { margin: .15rem 0 .6rem; }

.ac-lock { display: flex; align-items: flex-start; gap: .5rem; color: var(--ink-2); }
.ac-lock .ico { color: var(--ochre); margin-top: .1rem; width: 16px; height: 16px; }

/* quick list */
.ac-quick { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
.ac-quick li { border-top: 1px solid var(--line-2); }
.ac-quick li:nth-child(-n+2) { border-top: 0; }
.ac-quick button { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; border: 0; background: none; padding: .75rem .1rem; border-radius: 0; gap: .8rem; }
.ac-quick button:hover { border: 0; color: var(--forest); }
.ac-quick button > .ico:first-child { color: var(--forest); width: 20px; height: 20px; }
.ac-quick button > .ico:last-child { margin-left: auto; color: var(--muted); }
.ac-quick button > span { min-width: 0; flex: 1; }
.ac-quick b { display: block; font-weight: 600; }
.ac-quick small { display: block; color: var(--muted); font-size: .82rem; font-weight: 400; }

/* field storage */
.ac-store-figs { display: flex; flex-wrap: wrap; gap: .75rem 2.5rem; margin-bottom: .8rem; }
.ac-store-figs span { display: block; font-size: .8rem; color: var(--muted); }
.ac-store-figs b { display: block; font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.ac-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-2); }
.ac-seg button { border: 0; background: transparent; min-height: 30px; padding: .2rem .7rem; border-radius: 6px; color: var(--muted); font-size: .84rem; gap: .4rem; }
.ac-seg button:hover { color: var(--ink); border: 0; }
.ac-seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.ac-seg .num { font-size: .78rem; color: var(--muted); }

.ac-files { list-style: none; margin: 0; padding: 0; }
.ac-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .4rem .9rem; padding: .75rem 0; }
.ac-file + .ac-file { border-top: 1px solid var(--line-2); }
.ac-files.compact { margin-top: .6rem; }
.ac-files.compact .ac-file { padding: .55rem 0; }
.ac-file-ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--karst-soft); color: var(--karst); flex: none; }
.ac-file.giao_viec .ac-file-ico { background: var(--hydro-soft); color: var(--hydro); }
.ac-file-main { min-width: 0; }
.ac-file-name { display: block; font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; }
.ac-file-meta { display: flex; flex-wrap: wrap; gap: .15rem .9rem; font-size: .8rem; color: var(--muted); margin-top: .15rem; font-variant-numeric: tabular-nums; }
.ac-file-meta code { font-size: .78rem; overflow-wrap: anywhere; }
.ac-kind { font-weight: 600; color: var(--karst); }
.ac-kind.giao_viec { color: var(--hydro); }
.ac-file-act { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .35rem; }
.ac-del { color: var(--muted); }
.ac-del:hover { color: var(--bad); }
.ac-confirm-q { color: var(--bad); font-weight: 500; margin-right: .25rem; }

.ac-locked { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem 1.25rem; align-items: start; }
.ac-locked h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.ac-locked p { max-width: 64ch; color: var(--ink-2); }
.ac-locked-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--ochre-soft); color: var(--ochre); }
.ac-locked-ico .ico { width: 22px; height: 22px; }

.ac-howto { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 2rem; }
.ac-howto h4 { margin-top: 0; }
.ac-steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.ac-steps li { counter-increment: st; position: relative; padding: 0 0 .7rem 2.1rem; font-size: .9rem; color: var(--ink-2); }
.ac-steps li::before { content: counter(st); position: absolute; left: 0; top: -.05rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 600; color: var(--forest); border: 1px solid color-mix(in srgb, var(--forest) 45%, var(--line)); }
.ac-steps li:not(:last-child)::after { content: ""; position: absolute; left: .75rem; top: 1.55rem; bottom: .15rem; width: 1px; background: var(--line); }

/* generic row list (downloads, devices, donations, applications) */
.ac-list { list-style: none; margin: 0; padding: 0; }
.ac-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .7rem 0; }
.ac-list > li + li { border-top: 1px solid var(--line-2); }
.ac-list > li > div { min-width: 0; flex: 1 1 260px; }
.ac-list > li > div > b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.ac-list > li > div > .small { display: block; }
.ac-list > li.off > div > b { color: var(--ink-2); font-weight: 500; }
.ac-need { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--ochre); white-space: nowrap; }
.ac-need .ico { width: 14px; height: 14px; }
.ac-dl-group + .ac-dl-group { margin-top: .5rem; border-top: 1px solid var(--line-2); }
.ac-devs > li { flex-wrap: nowrap; }
.ac-devs > li > .ac-file-ico { background: var(--forest-soft); color: var(--forest); }
.ac-seen { text-align: right; }
.ac-dons .badge.intent { font-weight: 500; }

.ac-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .5rem 1.5rem; margin: 0; font-size: .93rem; }
.ac-dl dt { color: var(--muted); }
.ac-dl dd { margin: 0; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }


/* plans inside the dashboard */
.ac-product { margin-bottom: 1rem; }
.ac-product .product-head h2 { font-size: 1.15rem; }
.ac-more { margin-top: 1rem; font-size: .88rem; }
.ac-more summary { cursor: pointer; color: var(--forest); font-weight: 500; }
.ac-feats { list-style: none; margin: .5rem 0 0; padding: 0; }
.ac-feats li { display: flex; justify-content: space-between; gap: .75rem; padding: .3rem 0; border-top: 1px solid var(--line-2); color: var(--ink-2); }
.ac-otp-in { max-width: 12rem; }
.ac-otp { border-top: 0; padding: 0; }

/* ------------------------------------------------------------------ narrow screens */
@media (max-width: 1000px) {
    .ac-sheet { grid-template-columns: minmax(0, 1fr); }
    .ac-legend li:first-child { padding-left: 0; }
    .ac-grid { grid-template-columns: minmax(0, 1fr); }
    .ac-grid > .ac-panel { height: auto; }
}
@media (max-width: 860px) {
    .ac-body { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding-top: 0; }
    .ac-nav { position: sticky; top: 0; z-index: 10; margin: 0 -16px; padding: .5rem 16px; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line-2); display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
    .ac-nav::-webkit-scrollbar { display: none; }
    .ac-nav ul { display: flex; gap: .25rem; }
    .ac-nav a, .ac-nav-out { width: auto; white-space: nowrap; padding: .4rem .75rem; margin: 0; border-radius: 999px; font-size: .88rem; }
    .ac-nav a[aria-current="page"] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--forest) 35%, transparent); }
    .ac-nav a .ico { display: none; }
    .ac-nav a[aria-current="page"] .ico { display: none; }
    .ac-nav-out { margin: 0; padding-top: .4rem; border-top: 0; }
    .ac-nav-out span { display: none; }
    .ac-main { padding-top: .5rem; }
    .ac-quick { grid-template-columns: minmax(0, 1fr); }
    .ac-quick li:nth-child(2) { border-top: 1px solid var(--line-2); }
    .ac-howto { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .ac-collar { padding-bottom: 1.4rem; }
    .ac-bar .row { flex-wrap: nowrap; gap: .4rem; }
    .ac-top a.site { padding: .3rem .45rem; }
    .ac-sheet { padding: 1.4rem 1rem 1.1rem; gap: 1rem; }
    .ac-who { gap: .75rem; }
    .ac-avatar { width: 42px; height: 42px; font-size: 1.1rem; }
    .ac-who h1 { font-size: 1.2rem; }
    .ac-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .ac-legend li { padding: 0; }
    .ac-legend-t { font-size: 1rem; white-space: normal; }
    .ac-seg { display: flex; width: 100%; }
    .ac-seg button { flex: 1 1 auto; padding: .2rem .45rem; font-size: .8rem; }
    .ac-legend li + li { border-left: 1px solid rgba(214, 166, 114, .3); padding-left: .75rem; }
    .ac-head h2 { font-size: 1.3rem; }
    .ac-panel { padding: 1rem 1rem 1.1rem; }
    .ac-file { grid-template-columns: auto minmax(0, 1fr); }
    .ac-file-act { grid-column: 2; justify-content: flex-start; }
    .ac-files.compact .ac-file { grid-template-columns: auto minmax(0, 1fr) auto; }
    .ac-files.compact .ac-file-act { grid-column: auto; }
    .ac-locked { grid-template-columns: minmax(0, 1fr); }
    .ac-dl { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
    .ac-dl dd { margin-bottom: .5rem; }
    .ac-devs > li { flex-wrap: wrap; }
    .ac-seen { text-align: left; flex-basis: 100%; padding-left: calc(36px + 1rem); }
    .ac-store-figs { gap: .5rem 1.5rem; }
    .ac-store-figs b { font-size: 1.3rem; }
    .ac-foot { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .ac-top .topo { animation: none !important; } }
@media print { .ac-top, .ac-nav, .ac-foot { display: none; } }
.ac-dl + .hint { margin-top: .9rem; }

/* Tải ứng dụng: các bước cài ngay dưới nút tải */
.ac-panel .form-actions + .ac-steps { margin-top: 1rem; }

/* Patrol Studio: legal-text reader, consent boxes, platform hint */
.ac-doc { margin: .6rem 0 1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); max-height: 22rem; overflow: auto; outline: none; }
.ac-doc[hidden] { display: none; }
.ac-doc h4 { margin: 0 0 .5rem; }
.ac-doc .ac-panel-head { margin-bottom: .4rem; }
.ac-doc .prose p { margin: 0 0 .6rem; white-space: pre-line; }
.ac-consent { margin: 1rem 0; }
.ac-consent label.check { align-items: flex-start; line-height: 1.45; }
.ac-consent label.check input { margin-top: .25rem; flex: none; }
.ac-guess { display: inline-block; padding: 0 .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--ochre-soft); color: var(--ochre); }
.ac-form textarea { width: 100%; }
