:root {
  --bg: #f1f1f3;
  --panel: #ffffff;
  --panel-soft: #f7f7f9;
  --line: #d9dbe2;
  --text: #111215;
  --muted: #666a73;
  --accent: #1f3a8a;
  --accent-2: #284db8;
  --danger: #cc4455;
  --ok: #188a4a;
  --radius: 24px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Avenir Next', 'SF Pro Text', 'Nunito Sans', 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 400px at 100% -15%, rgba(255, 255, 255, 0.7), transparent 70%),
    radial-gradient(700px 380px at -10% 10%, rgba(255, 255, 255, 0.45), transparent 72%),
    var(--bg);
  min-height: 100vh;
}

.theme-toggle {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 50;
  border: 1px solid #d1d5df;
  background: rgba(255, 255, 255, 0.94);
  color: #1a1c22;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 7px 16px rgba(19, 25, 39, 0.12);
}

.theme-toggle:hover {
  background: #f6f8fc;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.4;
  filter: blur(70px);
  z-index: 0;
}

.ambient-a {
  width: 360px;
  height: 360px;
  background: rgba(188, 220, 255, 0.45);
  top: -160px;
  left: -90px;
}

.ambient-b {
  width: 320px;
  height: 320px;
  background: rgba(255, 212, 228, 0.35);
  bottom: -160px;
  right: -90px;
}

.wrap {
  position: relative;
  z-index: 2;
  width: min(1060px, 100%);
  margin: 0 auto;
  padding: 18px 14px 30px;
  display: grid;
  gap: 14px;
}

.vault-app {
  width: min(460px, 100%);
  padding: 16px 10px 120px;
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(12, 18, 32, 0.08);
}

.glass {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 3.8vw, 40px);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.sub,
.muted-text,
.empty {
  color: var(--muted);
}

.shield {
  border: 1px solid #b7e4c8;
  background: #eaf9f0;
  color: #1a5f37;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.metrics {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid #dfe3eb;
  border-radius: 14px;
  padding: 10px;
  background: #f9fbff;
}

.metric span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  color: #6c7484;
}

.metric strong {
  font-size: 21px;
}

.alert {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.alert.error {
  background: #ffecef;
  border-color: #f4b2bd;
  color: #7d1828;
}

.alert.ok {
  background: #ebf9f0;
  border-color: #abdcb9;
  color: #0d6e3a;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid.dual {
  grid-template-columns: 1fr 1fr;
}

.form-grid .full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: #555a64;
  font-size: 13px;
}

input,
select,
textarea,
button,
.btn-link {
  font: inherit;
  border-radius: 14px;
  border: 1px solid #cfd3dd;
}

input,
select,
textarea {
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #8eb4ff;
  box-shadow: 0 0 0 3px rgba(73, 118, 226, 0.17);
}

button,
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  background: #eef2ff;
  color: #1a2f6f;
  border-color: #c6d2fd;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

button:hover,
.btn-link:hover {
  background: #e4ebff;
}

button.danger {
  background: #fee8ec;
  border-color: #f7bcc7;
  color: #8f1d31;
}

.btn-link.subtle {
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
}

.nav-card {
  padding: 10px;
}

.top-menu {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.menu-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 13px;
  border: 1px solid #d2d6e0;
  color: #2d3240;
  text-decoration: none;
  background: #fff;
  font-weight: 700;
}

.menu-item.active {
  color: #fff;
  background: #2745a0;
  border-color: #2745a0;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search {
  display: flex;
  gap: 8px;
  flex: 1 1 320px;
}

.search input {
  flex: 1 1 auto;
}

.strength-wrap {
  display: grid;
  gap: 6px;
}

.strength-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #e4e8f2;
  overflow: hidden;
}

.strength-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ff8fa2, #ffd375, #74d8a6, #65b4ff);
  transition: width .2s ease;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid #e3e6ed;
  padding: 9px 7px;
  text-align: left;
}

th {
  color: #454d61;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #c8d4f6;
  background: #eef3ff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-link {
  color: #20479f;
  text-decoration: none;
  border-bottom: 1px dashed #8dadf8;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.actions form {
  margin: 0;
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.inline-tools {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.inline-tools input {
  width: 100%;
}

.users-grid h3 {
  margin: 0 0 4px;
}

.vault-app .hero {
  display: none;
}

.app-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px;
  font-weight: 700;
}

.status-time {
  font-size: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #000;
  color: #fff;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  min-width: 162px;
  justify-content: center;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f8a529;
}

.status-battery {
  font-size: 16px;
  border: 2px solid #202020;
  border-radius: 9px;
  padding: 1px 8px;
  line-height: 1.2;
}

.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.home-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #335a36;
  background: #cce9cb;
  border: 1px solid #b6dbb5;
}

.home-actions {
  display: flex;
  gap: 10px;
}

.circle-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid #e3e5eb;
  text-decoration: none;
  color: #101114;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.7);
  font-size: 23px;
  line-height: 1;
}

.home-title {
  margin: 0;
  font-size: 58px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.profile-prompt {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #d7dae2;
  background: #fff;
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 8px 22px rgba(23, 28, 40, 0.06);
}

.profile-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #edf3ff;
  font-size: 24px;
}

.prompt-title {
  font-size: 20px;
  font-weight: 700;
}

.prompt-sub {
  color: var(--muted);
  font-size: 15px;
}

.chev {
  font-size: 34px;
  text-decoration: none;
  color: #b2b6c2;
  line-height: 1;
}

.feature-card {
  border-radius: 24px;
  padding: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 14%, rgba(104, 150, 255, 0.38), transparent 34%),
    radial-gradient(circle at 78% 76%, rgba(102, 134, 255, 0.42), transparent 28%),
    linear-gradient(180deg, #1f2d6a, #18265e);
  box-shadow: 0 16px 34px rgba(19, 27, 60, 0.35);
}

.feature-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.feature-top strong {
  font-size: 22px;
}

.feature-close {
  font-size: 30px;
  opacity: 0.9;
}

.feature-card h3 {
  margin: 6px 0 8px;
  font-size: 46px;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.feature-card p {
  margin: 0 0 12px;
  font-size: 21px;
  color: rgba(247, 250, 255, 0.9);
}

.search-inline {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto auto;
}

.search-inline input {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.search-inline input::placeholder {
  color: rgba(255, 255, 255, 0.74);
}

.search-inline button,
.search-inline .btn-link {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.sheet {
  border-radius: 22px;
  background: #fff;
}

.favorites-card {
  border-radius: 22px;
  padding: 12px;
  border: 1px solid #dadddf;
  background: #fff;
  box-shadow: 0 9px 20px rgba(20, 24, 34, 0.07);
}

.favorites-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  padding: 2px 4px 8px;
}

.favorites-head strong {
  font-size: 32px;
  letter-spacing: -0.02em;
}

.favorites-count {
  color: #5f6472;
  font-size: 16px;
}

.favorite-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 2px;
  border-top: 1px solid #eceff4;
}

.favorite-row:first-of-type {
  border-top: 0;
}

.favorite-empty {
  color: #6b707c;
  padding: 8px 4px 2px;
}

.fav-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #4d535e;
  background: #e2f0df;
  border: 1px solid #d3e4d0;
}

.fav-title {
  font-size: 27px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.fav-sub {
  color: #697080;
  font-size: 16px;
  margin-top: 2px;
}

.fav-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mini-link {
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  color: #2e4ca6;
  border: 1px solid #d6ddf6;
  background: #f3f6ff;
  border-radius: 999px;
  padding: 4px 8px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(430px, calc(100% - 18px));
  border-radius: 999px;
  border: 1px solid #d9dde6;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 15px 35px rgba(17, 24, 38, 0.14);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  z-index: 20;
}

.tab {
  border-radius: 999px;
  min-height: 42px;
  text-decoration: none;
  color: #1e2128;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.tab.active {
  background: #dfe6ff;
  color: #274fb8;
}

@media (max-width: 980px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .form-grid.dual { grid-template-columns: 1fr; }
  .users-grid { grid-template-columns: 1fr; }
  .inline-tools { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .hero-top {
    flex-direction: column;
  }

  .actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .vault-app .home-title {
    font-size: 46px;
  }

  .vault-app .feature-card h3 {
    font-size: 36px;
  }

  .vault-app .feature-card p {
    font-size: 18px;
  }

  .vault-app .fav-title {
    font-size: 22px;
  }

  .search-inline {
    grid-template-columns: 1fr;
  }
}

:root[data-theme='dark'] body {
  color: #e8edf8;
  background:
    radial-gradient(900px 420px at 100% -15%, rgba(111, 130, 179, 0.18), transparent 70%),
    radial-gradient(700px 380px at -10% 10%, rgba(89, 107, 151, 0.18), transparent 72%),
    #0d111a;
}

:root[data-theme='dark'] .theme-toggle {
  background: rgba(20, 26, 39, 0.92);
  color: #d8e1f8;
  border-color: #3a435d;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

:root[data-theme='dark'] .theme-toggle:hover {
  background: #232c3f;
}

:root[data-theme='dark'] .ambient-a {
  background: rgba(96, 126, 184, 0.45);
}

:root[data-theme='dark'] .ambient-b {
  background: rgba(102, 83, 140, 0.42);
}

:root[data-theme='dark'] .card,
:root[data-theme='dark'] .profile-prompt,
:root[data-theme='dark'] .favorites-card,
:root[data-theme='dark'] .sheet,
:root[data-theme='dark'] .menu-item,
:root[data-theme='dark'] input,
:root[data-theme='dark'] select,
:root[data-theme='dark'] textarea {
  background: #141b29;
  color: #e7ecf8;
  border-color: #333d54;
}

:root[data-theme='dark'] .glass {
  background: rgba(20, 26, 39, 0.84);
}

:root[data-theme='dark'] .sub,
:root[data-theme='dark'] .muted-text,
:root[data-theme='dark'] .empty,
:root[data-theme='dark'] .prompt-sub,
:root[data-theme='dark'] .fav-sub,
:root[data-theme='dark'] th {
  color: #b5c0db;
}

:root[data-theme='dark'] .hero,
:root[data-theme='dark'] .metric {
  background: #182133;
  border-color: #36415a;
}

:root[data-theme='dark'] .metric span {
  color: #9caaca;
}

:root[data-theme='dark'] button,
:root[data-theme='dark'] .btn-link,
:root[data-theme='dark'] .mini-link,
:root[data-theme='dark'] .circle-btn,
:root[data-theme='dark'] .tab {
  background: #1d2940;
  color: #dce6ff;
  border-color: #3a4c73;
}

:root[data-theme='dark'] button:hover,
:root[data-theme='dark'] .btn-link:hover,
:root[data-theme='dark'] .mini-link:hover,
:root[data-theme='dark'] .circle-btn:hover,
:root[data-theme='dark'] .tab:hover {
  background: #243450;
}

:root[data-theme='dark'] .menu-item.active,
:root[data-theme='dark'] .tab.active {
  background: #365fcd;
  color: #f5f8ff;
  border-color: #4d73d7;
}

:root[data-theme='dark'] button.danger {
  background: #40212c;
  color: #ffcad4;
  border-color: #6b3345;
}

:root[data-theme='dark'] .profile-icon,
:root[data-theme='dark'] .fav-icon,
:root[data-theme='dark'] .home-avatar {
  background: #212e43;
  border-color: #334764;
  color: #d3ddf4;
}

:root[data-theme='dark'] .status-pill {
  background: #02040a;
  color: #f5f7ff;
}

:root[data-theme='dark'] .status-battery {
  border-color: #bac5e2;
  color: #dbe4fb;
}

:root[data-theme='dark'] .feature-card {
  background:
    radial-gradient(circle at 90% 14%, rgba(119, 157, 255, 0.3), transparent 34%),
    radial-gradient(circle at 78% 76%, rgba(85, 117, 213, 0.4), transparent 28%),
    linear-gradient(180deg, #1b295e, #131d47);
}

:root[data-theme='dark'] .search-inline input {
  background: rgba(18, 28, 58, 0.7);
  border-color: rgba(179, 199, 255, 0.3);
}

:root[data-theme='dark'] .favorite-row,
:root[data-theme='dark'] th,
:root[data-theme='dark'] td {
  border-color: #2d3650;
}

:root[data-theme='dark'] .site-link {
  color: #96bcff;
  border-bottom-color: #7aa3f5;
}

:root[data-theme='dark'] .bottom-nav {
  background: rgba(17, 23, 35, 0.92);
  border-color: #36425c;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
}
