:root {
  --background-dark: #0a1020;
  --background-light: #121b34;
  --panel-color: rgba(19, 29, 56, 0.72);
  --border-color: rgba(255, 255, 255, 0.12);
  --text-color: #edf2ff;
  --muted-color: #aab5d6;
  --primary-color: #6fa8ff;
  --danger-color: #eb5e5e;
  --shadow-color: 0 20px 50px rgba(0, 0, 0, 0.35);
  --large-radius: 24px;
  --medium-radius: 18px;
  --max-width: 1440px;
  --transition-speed: 180ms ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  color: var(--text-color);
  background: linear-gradient(
    135deg,
    var(--background-dark),
    var(--background-light)
  );
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
}

input[type="text"],
input[type="password"],
input[type="search"] {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-color);
  outline: none;
  transition: border-color var(--transition-speed),
    background var(--transition-speed);
}

input::placeholder {
  color: rgba(237, 242, 255, 0.45);
}

input:focus {
  border-color: rgba(111, 168, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
}

.app-shell {
  max-width: var(--max-width);
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

.sidebar,
.panel,
.footer {
  background: var(--panel-color);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-color);
}

.sidebar {
  padding: 1.5rem;
  border-radius: var(--large-radius);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  border-radius: 16px;
  background: rgba(111, 168, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.brand h1,
.topbar h2,
.panel-header h3 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-color);
}

.stats-card,
.info-card {
  padding: 1.1rem;
  border-radius: var(--medium-radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-card h2,
.info-card h2 {
  margin: 0 0 0.9rem;
  font-size: 1rem;
}

.stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.search-wrap {
  min-width: 320px;
}

.panel {
  padding: 1.35rem;
  border-radius: var(--large-radius);
}

.panel-header {
  margin-bottom: 1.25rem;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.vault-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.field label {
  color: var(--muted-color);
  font-size: 0.94rem;
}

.password-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}

.generator-box {
  padding: 1rem;
  border-radius: var(--medium-radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.55rem;
}

.range-row input[type="range"] {
  width: 220px;
}

.range-value {
  min-width: 40px;
  padding: 0.35rem 0.6rem;
  text-align: center;
  border-radius: 999px;
  background: rgba(111, 168, 255, 0.14);
  border: 1px solid rgba(111, 168, 255, 0.24);
}

.strength-preview {
  margin: 1rem 0;
}

.strength-preview span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted-color);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.check-option input {
  accent-color: var(--primary-color);
}

.generator-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  border-radius: 14px;
  transition: transform var(--transition-speed),
    background var(--transition-speed);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  padding: 0.95rem 1.15rem;
  background: var(--primary-color);
  color: #08101f;
  font-weight: 700;
}

.secondary-btn {
  padding: 0.9rem 1rem;
  background: rgba(111, 168, 255, 0.16);
  color: var(--text-color);
  border: 1px solid rgba(111, 168, 255, 0.3);
}

.ghost-btn {
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.danger-btn {
  padding: 0.9rem 1rem;
  background: rgba(235, 94, 94, 0.16);
  color: #ffd7d7;
  border: 1px solid rgba(235, 94, 94, 0.32);
}

.icon-btn {
  width: 48px;
  min-width: 48px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-btn {
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
}

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

thead th {
  padding: 0 0 1rem;
  text-align: left;
  color: var(--muted-color);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

tbody td {
  padding: 1rem 0;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

td.actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.strength-badge {
  display: inline-block;
  min-width: 92px;
  padding: 0.45rem 0.7rem;
  text-align: center;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.strength-weak {
  background: rgba(235, 94, 94, 0.18);
  color: #ffc1c1;
  border: 1px solid rgba(235, 94, 94, 0.3);
}

.strength-medium {
  background: rgba(216, 166, 61, 0.18);
  color: #ffe2a3;
  border: 1px solid rgba(216, 166, 61, 0.3);
}

.strength-strong {
  background: rgba(54, 201, 139, 0.18);
  color: #bcffe2;
  border: 1px solid rgba(54, 201, 139, 0.3);
}

.masked-password {
  letter-spacing: 0.12em;
}

.empty-state {
  padding: 2rem 0;
  text-align: center;
  color: var(--muted-color);
}

.footer {
  padding: 1.25rem;
  border-radius: var(--large-radius);
  text-align: center;
}

.footer p {
  margin: 0.35rem 0;
  color: var(--muted-color);
}

.footer a {
  color: var(--text-color);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(18, 27, 52, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-color);
  box-shadow: var(--shadow-color);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity var(--transition-speed),
    transform var(--transition-speed);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .topbar,
  .table-header {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrap {
    min-width: 100%;
  }

  .checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 1rem;
  }

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

  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .range-row {
    flex-wrap: wrap;
  }

  .range-row input[type="range"] {
    width: 100%;
  }
}