/* Account Vault V26 — Premium UI Refinement / Design System
   Additive stylesheet, dashboard-only scope. No scripts, fonts, trackers or network requests.
   Auth, entry modal, crypto and server behavior deliberately out of scope. */
:root {
  --av26-indigo: #6757ed;
  --av26-indigo-deep: #5240da;
  --av26-ink: #1c2945;
  --av26-subtext: #667694;
  --av26-line: #e3e8f4;
  --av26-canvas: #f4f6fc;
  --av26-hover: #f7f7ff;
  --av26-focus: rgba(107, 91, 235, .16);
  --av26-elev: 0 2px 5px rgba(18, 32, 70, .025), 0 12px 32px rgba(18, 32, 70, .048);
  --av26-elev-hover: 0 5px 14px rgba(18, 32, 70, .035), 0 20px 38px rgba(18, 32, 70, .070);
  --av26-curve: cubic-bezier(.22,1,.36,1);
  --av26-fast: 150ms;
  --av26-normal: 200ms;
  --av26-r-sm: 12px;
  --av26-r-md: 17px;
  --av26-r-lg: 20px;
  --av26-space-1: 4px;
  --av26-space-2: 8px;
  --av26-space-3: 12px;
  --av26-space-4: 16px;
  --av26-space-6: 24px;
  --av26-space-8: 32px;
}
:root[data-theme="dark"] {
  --av26-indigo: #ab9dff;
  --av26-indigo-deep: #8e7bfd;
  --av26-ink: #eaf0fc;
  --av26-subtext: #b1bfd5;
  --av26-line: #34445c;
  --av26-canvas: #111c2e;
  --av26-hover: #24314a;
  --av26-focus: rgba(171,157,255,.22);
  --av26-elev: 0 6px 23px rgba(0,0,0,.14);
  --av26-elev-hover: 0 10px 31px rgba(0,0,0,.23);
}
/* ---------------- Global dashboard typography and spacing ---------------- */
.shell { min-width: 0; }
.shell .workspace { min-width: 0; background: radial-gradient(ellipse at 95% 0%, rgba(112,96,232,.055), transparent 32%), var(--bg, #f4f6fc); }
.shell .content { min-width: 0; padding-top: clamp(23px, 2.5vw, 36px); padding-bottom: clamp(44px, 5vw, 68px); }
.shell .page-head { gap: 18px; margin-bottom: clamp(20px, 2.3vw, 28px); }
.shell .page-head h1 { font-size: clamp(25px, 2.1vw, 33px); letter-spacing: -.036em; line-height: 1.22; text-wrap: balance; }
.shell .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .15em; line-height: 1.5; }
.shell .page-head p, .shell .page-head .muted { font-size: 13.5px; line-height: 1.65; color: var(--subtle, var(--av26-subtext)); }
.shell :is(.hint,.stat-sub,.chart-meta,.recent-date) { line-height: 1.55; }
.shell :is(.panel, .stat-card, .service-card, .table-panel, .feature-panel, .av23-panel) { min-width: 0; }
.shell :is(.panel, .stat-card, .service-card, .table-panel) {
  border-radius: var(--av26-r-md);
  border-color: var(--border, var(--av26-line));
  box-shadow: var(--av26-elev);
  transition: border-color var(--av26-normal) ease, box-shadow var(--av26-normal) ease;
}
.shell :is(.panel, .stat-card, .service-card):hover { box-shadow: var(--av26-elev-hover); }
.shell .panel-head h3 { font-size: 15px; letter-spacing: -.01em; }
.shell .panel-head { margin-bottom: clamp(12px, 1.5vw, 20px); }
/* ---------------- Navbar: grouping without moving or removing controls ---------------- */
.shell .topbar { min-width: 0; gap: 14px; padding-block: 10px; min-height: 68px; height: auto; }
.shell .topbar-left, .shell .topbar-right { min-width: 0; gap: clamp(7px, 1vw, 14px); }
.shell .topbar-right { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.shell .breadcrumbs { line-height: 1.4; }
.shell .topbar-security, .shell .vault-status { border-radius: 11px; }
/* ---------------- Sidebar navigation (preserves existing width and position) ---------------- */
.shell .sidebar .nav-label { letter-spacing: .12em; }
.shell .sidebar :is(.nav-link, .service-nav-link) {
  border-radius: 11px;
  font-size: 13px;
  line-height: 1.45;
  transition: background-color var(--av26-normal) ease, color var(--av26-normal) ease, box-shadow var(--av26-normal) ease;
}
.shell .sidebar :is(.nav-link, .service-nav-link):focus-visible { outline: 2px solid #b0a4ff; outline-offset: 2px; }
.shell .sidebar .sidebar-bottom { padding-top: 10px; }
/* ---------------- Dashboard: avoid giant equal-height charts ---------------- */
.shell .stats-grid { gap: clamp(12px, 1.2vw, 18px); }
.shell .stat-card { padding: clamp(18px, 1.4vw, 23px); }
.shell .stat-value { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.shell .stat-sub { color: var(--subtle, var(--av26-subtext)); font-size: 12.5px; }
.shell .dashboard-grid { align-items: start; gap: clamp(14px, 1.4vw, 20px); }
.shell .dashboard-grid > .panel { height: auto; min-height: 0; }
.shell .chart-list { gap: 15px; margin-top: clamp(14px, 1.8vw, 22px); }
.shell .chart-track { height: 8px; border-radius: 999px; }
.shell .chart-fill { border-radius: inherit; }
.shell .chart-meta span:nth-child(2) { font-size: 13px; }
.shell .quick-list button {
  min-height: 60px;
  border-radius: var(--av26-r-sm);
  padding-inline: 10px;
  transition: background-color var(--av26-fast) ease, color var(--av26-fast) ease;
}
.shell .quick-list button:hover { background: var(--av26-hover); }
.shell .recent-panel { margin-top: 18px; }
.shell .recent-row { border-radius: 10px; padding-inline: 10px; }
.shell .recent-row:hover { background: var(--av26-hover); }
/* ---------------- Services: responsive, compact, discoverable ---------------- */
.shell .service-grid { gap: clamp(13px, 1.5vw, 20px); align-items: start; }
.shell .service-card { display: flex; flex-direction: column; min-height: 195px; padding: clamp(18px, 1.5vw, 23px); }
.shell .service-card-top { gap: 10px; margin-bottom: 15px; }
.shell .service-card-link { margin-top: auto; }
.shell .field-chips { gap: 6px; }
.shell .field-chips > * { overflow-wrap: anywhere; }
/* ---------------- Tables and empty states ---------------- */
.shell .table-panel { overflow: hidden; }
.shell .table-toolbar { display: flex; align-items: center; flex-wrap: wrap; row-gap: 10px; column-gap: 10px; padding: clamp(14px, 1.5vw, 22px); }
.shell .table-toolbar > * { min-width: 0; }
.shell .table-toolbar .search-input { flex: 1 1 220px; max-width: 500px; min-width: min(220px,100%); border-radius: var(--av26-r-sm); }
.shell .table-toolbar .search-input input { min-height: 40px; }
.shell .table-count { font-variant-numeric: tabular-nums; }
.shell .table-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
.shell .data-table { width: 100%; }
.shell .data-table thead th { font-size: 12px; letter-spacing: .025em; white-space: nowrap; }
.shell .data-table tbody td { line-height: 1.5; }
.shell .data-table tbody tr:focus-within td { background: var(--primary-soft, #f0edff); }
.shell :is(.empty-state, .table-empty, .service-empty) { min-height: 200px; max-width: 100%; }
.shell .empty-state { gap: 12px; padding: clamp(25px, 3.2vw, 44px) 22px; }
.shell .empty-state h3 { font-size: 16px; letter-spacing: -.02em; }
.shell .empty-state p { max-width: 400px; font-size: 13.5px; line-height: 1.7; color: var(--subtle, var(--av26-subtext)); }
.shell .empty-symbol { width: 64px; height: 64px; border-radius: 20px; }
.shell .empty-symbol svg { width: 28px; height: 28px; }
/* ---------------- Controls, buttons, cards (NOT auth / modals) ---------------- */
.shell .content :is(.btn, .mini-btn, .icon-button) { border-radius: 11px; }
.shell .content .btn { min-height: 42px; }
.shell .content :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { border-radius: 11px; }
.shell .content :is(input:not([type="checkbox"]):not([type="radio"]),select) { min-height: 42px; }
.shell .content :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea):focus-visible {
  outline: 2px solid var(--av26-indigo);
  outline-offset: 2px;
  border-color: var(--av26-indigo);
}
.shell .content :is(input,textarea)::placeholder { color: var(--subtle, var(--av26-subtext)); opacity: .86; }
.shell .content .btn-primary:not(:disabled) {
  background: linear-gradient(135deg,#7768f5 0%,#5c4add 100%);
  box-shadow: 0 6px 18px rgba(99,85,232,.17);
}
.shell .content .btn-primary:not(:disabled):hover { box-shadow: 0 9px 24px rgba(99,85,232,.24); }
.shell .content .btn:not(:disabled):active { transform: scale(.98); }
.shell .content :is(.checkbox-label, input[type="checkbox"]) { accent-color: var(--primary, #6757ed); }
.shell .content input[type="checkbox"] { width: 17px; height: 17px; flex: none; }
/* ---------------- Settings, backup and advanced tools ---------------- */
.shell .settings-grid { gap: clamp(13px, 1.4vw, 20px); align-items: stretch; }
.shell .feature-panel { gap: 11px; min-height: 0; }
.shell .feature-panel h3 { font-size: 16px; line-height: 1.35; }
.shell .feature-panel p { font-size: 13px; line-height: 1.65; max-width: 62ch; }
.shell .feature-panel .btn { margin-top: auto; }
.shell .callout, .shell .note-box { border-radius: var(--av26-r-sm); line-height: 1.65; }
.shell .event-list { max-width: 100%; }
.shell .event-list > * { min-width: 0; }
.shell .security-foot { line-height: 1.65; }
/* ---------------- Motion discipline: no forced row entrance on filtering ---------------- */
.shell .stat-card, .shell .service-card { will-change: auto; }
@media (hover:none) {
  .shell :is(.panel,.stat-card,.service-card):hover { box-shadow: var(--av26-elev); }
  .shell .service-card:hover { transform: none; }
}
@media (max-width:1100px) {
  .shell .service-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .shell .dashboard-grid { gap: 14px; }
}
@media (max-width:780px) {
  .shell .content { padding-inline: clamp(12px,3vw,22px); padding-top: 20px; }
  .shell .page-head { align-items: flex-start; flex-wrap: wrap; }
  .shell .page-head h1 { font-size: clamp(23px,5vw,30px); }
  .shell .dashboard-grid, .shell .settings-grid { grid-template-columns: minmax(0,1fr); }
  .shell .topbar { padding-block: 10px; }
  .shell .topbar-right { gap: 7px; }
  .shell .service-card { min-height: 175px; }
}
@media (max-width:520px) {
  .shell .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .shell .stat-card { padding: 16px; }
  .shell .service-grid { grid-template-columns: minmax(0,1fr); }
  .shell .table-toolbar .search-input { flex-basis: 100%; max-width: none; }
  .shell .empty-state { min-height: 175px; }
  .shell .quick-list button { min-height: 56px; }
  .shell .topbar-left, .shell .topbar-right { gap: 6px; }
}
@media (prefers-reduced-motion:reduce) {
  .shell :is(.panel,.stat-card,.service-card,.quick-list button,.recent-row,.nav-link,.service-nav-link) {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .shell .service-card:hover { transform: none; }
}


/* AV_TABLE_ACTION_PREFS_V1 — UI preferences; secrets remain masked by default */
html.av-ui-hide-copy .shell [data-action="copy-field"],
html.av-ui-hide-copy .shell [data-action="copy-username"],
html.av-ui-hide-eye .shell [data-action="toggle-secret"] {
  display: none !important;
}
html.av-ui-hide-copy.av-ui-hide-eye .shell .table-secret-controls {
  display: none !important;
}
.shell .av-ui-pref-card { gap: 12px; }
.shell .av-ui-pref-card .av-ui-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border, #e4e8f1);
  border-radius: 11px;
  background: var(--surface-alt, #f8f9fd);
  cursor: pointer;
}
.shell .av-ui-pref-card .av-ui-pref-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.shell .av-ui-pref-card .av-ui-pref-copy strong {
  font-size: 12px;
  font-weight: 750;
  color: var(--text, #26334d);
}
.shell .av-ui-pref-card .av-ui-pref-copy small,
.shell .av-ui-pref-card .av-ui-pref-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted, #8996a8);
}
.shell .av-ui-pref-card input[data-ui-pref] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: block;
  width: 43px;
  height: 25px;
  margin: 0;
  flex: 0 0 43px;
  border-radius: 50px;
  border: 1px solid #cdd4e4;
  background: #d6dce8;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.shell .av-ui-pref-card input[data-ui-pref]::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #17233f26;
  transition: transform .16s ease;
}
.shell .av-ui-pref-card input[data-ui-pref]:checked {
  background: #6554e8;
  border-color: #6554e8;
}
.shell .av-ui-pref-card input[data-ui-pref]:checked::before {
  transform: translateX(18px);
}
.shell .av-ui-pref-card input[data-ui-pref]:focus-visible {
  outline: 3px solid #a79cff;
  outline-offset: 3px;
}
@media(prefers-reduced-motion:reduce) {
  .shell .av-ui-pref-card input[data-ui-pref],
  .shell .av-ui-pref-card input[data-ui-pref]::before {
    transition: none;
  }
}
