* {
  box-sizing: border-box;
}

body {
  --bg: radial-gradient(circle at 20% 20%, #0d1b2a, #0b1320 45%, #0a0f1a 70%, #060910);
  --card-bg: #0f172a;
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e4e8f0;
  --muted: rgba(228, 232, 240, 0.72);
  --accent: #7cc7ff;
  --accent-2: #9f7bff;
  --input-bg: #0a1220;
  --toolbar-bg: rgba(255, 255, 255, 0.06);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 64px;
  transition: background 0.3s ease, color 0.3s ease;
}

body.light {
  --bg: #f5f7fb;
  --card-bg: #ffffff;
  --card-border: #e3e7ef;
  --text: #1f2a44;
  --muted: rgba(31, 42, 68, 0.62);
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --input-bg: #f0f4ff;
  --toolbar-bg: #eef2fb;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
}

h1, h2, h3 {
  margin: 0 0 12px;
  color: #f2f4ff;
}

a {
  color: #7cc7ff;
}

.card {
  width: 100%;
  max-width: 1080px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

label {
  font-size: 13px;
  opacity: 0.85;
}

input, textarea, select, button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}

input:focus, textarea:focus, select:focus {
  outline: 1px solid #7cc7ff;
  border-color: #7cc7ff;
}

button {
  cursor: pointer;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.1px;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon input {
  width: 100%;
  padding-right: 38px;
}

.input-with-icon .icon-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: none;
  padding: 2px;
  width: 24px;
  min-width: 24px;
  height: 24px;
}

.input-with-icon.copy {
  padding-right: 34px;
}

.input-with-icon.copy input {
  padding-right: 60px;
}

.row button {
  width: auto;
  padding: 10px 16px;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  display: inline-block;
  margin-right: 6px;
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.card.credential {
  border: 1px solid rgba(124, 199, 255, 0.2);
}

.secret {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 10px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
  overflow: hidden;
}

.qr {
  margin-top: 8px;
  max-width: 220px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.danger {
  background: #ff7b7b;
  color: #0d0b14;
}

.toolbar {
  width: 100%;
  max-width: 1080px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.toolbar .card {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  width: 100%;
  flex-wrap: nowrap;
  justify-content: flex-start;
  padding: 6px 8px;
  overflow-x: auto;
  box-sizing: border-box;
  white-space: nowrap;
}

.toolbar input {
  width: auto;
}

.toolbar .row {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.toolbar .row > * {
  flex-shrink: 0;
}

#filter {
  flex: 1;
  min-width: 100px;
  width: auto;
}

.icon-btn {
  width: 26px;
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 8px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
}

.icon-btn.danger {
  background: #ff7b7b;
  color: #0d0b14;
  border-color: #ff7b7b;
}

.icon-btn.success {
  background: #4ade80;
  color: #0d0b14;
  border-color: #4ade80;
}

.material-icons-outlined {
  font-size: 20px;
  vertical-align: middle;
}

.secret-item {
  border: 1px solid var(--card-border);
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.secret-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 16px;
}

.modal .card {
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  background: var(--card-bg);
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  body {
    padding: 20px 12px;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
  }
}
