:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #eef2f7;
  --text: #111827;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e4e8ef;
  --line-strong: #d7dde7;
  --accent: #1d5cff;
  --accent-dark: #174bcc;
  --accent-soft: #eef4ff;
  --success: #159a68;
  --success-soft: #e9f8f0;
  --rose: #d92d20;
  --rose-soft: #fff1f0;
  --amber: #b7791f;
  --amber-soft: #fff7e6;
  --shadow: 0 18px 40px rgba(16, 24, 40, .09);
  --shadow-soft: 0 8px 22px rgba(16, 24, 40, .055);
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .56;
}

body.custom-dragging,
body.custom-dragging * {
  cursor: grabbing !important;
  user-select: none;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #f6f8fb;
}

.auth-panel {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.auth-panel h1 {
  margin: 0 0 8px;
  font-size: 27px;
  letter-spacing: 0;
}

.auth-panel p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.65;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  font-weight: 700;
  color: #344054;
  font-size: 13px;
}

.field input,
.field select,
.field textarea,
.search-input,
.toolbar-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-input:focus,
.toolbar-select:focus {
  border-color: rgba(29, 92, 255, .62);
  box-shadow: 0 0 0 3px rgba(29, 92, 255, .12);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.span-2 {
  grid-column: 1 / -1;
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-swatch {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.color-swatch:hover {
  border-color: #cfd6e2;
  transform: translateY(-1px);
}

.color-swatch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.color-swatch span {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}

.color-swatch:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 92, 255, .12);
}

.color-swatch input:checked + span {
  outline: 3px solid rgba(29, 92, 255, .18);
  outline-offset: 3px;
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(8, 42px);
  gap: 10px;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, 42px);
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  padding: 3px;
}

.icon-choice {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #475467;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}

.icon-choice:hover {
  border-color: #cfd6e2;
  background: #f8fafc;
}

.icon-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.icon-choice span {
  display: grid;
  place-items: center;
}

.icon-choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 92, 255, .10);
}

.avatar-letter-choice {
  font-weight: 900;
  font-size: 15px;
}

.ui-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary,
.secondary,
.danger,
.ghost {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(29, 92, 255, .18);
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: #1f2937;
  box-shadow: var(--shadow-soft);
}

.secondary:hover {
  border-color: #cfd6e2;
  background: #f9fbff;
}

.danger {
  background: var(--rose-soft);
  color: var(--rose);
}

.danger:hover {
  background: #ffe3e0;
}

.ghost {
  border: 1px solid transparent;
  background: transparent;
  color: #475467;
}

.ghost:hover {
  border-color: var(--line);
  background: #f4f7fb;
  color: var(--text);
}

.btn-icon {
  font-weight: 800;
  line-height: 1;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  background: rgba(255, 255, 255, .94);
  border-right: 1px solid var(--line);
  padding: 24px 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#sidebarContent {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 28px;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #1f2937;
  box-shadow: 0 12px 26px rgba(17, 24, 39, .16);
}

.brand-mark::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 9px;
  width: 16px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 8px 8px 7px 7px;
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 19px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 5px 0 -2px #fff;
}

.brand h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.nav-section {
  margin: 10px 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-title {
  padding: 0 10px 8px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 800;
}

.nav-button,
.group-row {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: #344054;
  background: transparent;
  text-align: left;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.nav-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
}

.group-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 58px;
}

.nav-button:hover,
.group-row:hover {
  background: #f5f8ff;
}

.nav-button.active,
.group-row.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.nav-button.drop-target,
.group-row.drop-target {
  outline: 2px solid rgba(29, 92, 255, .48);
  background: #edf4ff;
  transform: translateX(2px);
}

.nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #667085;
  font-weight: 800;
  line-height: 1;
}

.nav-button.active .nav-icon {
  color: var(--accent);
}

.group-nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f4f7fb;
}

.group-row.active .group-nav-icon {
  background: #fff;
}

.group-nav-icon .ui-icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.nav-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  font-weight: 650;
}

.count {
  min-width: 28px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #667085;
  background: #f2f4f7;
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.nav-button.active .count,
.group-row.active .count {
  background: #fff;
  color: var(--accent);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
  font-size: 0;
  box-shadow: 0 0 0 4px rgba(16, 24, 40, .06);
}

.row-tools {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity .15s ease, transform .15s ease;
}

.group-row:hover .row-tools,
.group-row.active .row-tools {
  opacity: 1;
  transform: translateX(0);
}

.mini {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f2f4f7;
  color: #667085;
  font-size: 12px;
}

.mini:hover {
  background: #e9eef6;
  color: var(--text);
}

.sidebar-status {
  flex-shrink: 0;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.sidebar-status:hover,
.sidebar-status:focus-visible {
  border-color: #cfd6e2;
  box-shadow: var(--shadow-soft);
  background: #fbfcff;
}

.sidebar-status.expanded {
  border-color: #bfe8d3;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--success);
}

.shield-mini {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--success-soft);
  font-size: 13px;
}

.sidebar-status p {
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #667085;
  font-size: 12px;
}

.usage-bar {
  height: 5px;
  border-radius: 999px;
  margin-top: 7px;
  background: #edf1f6;
  overflow: hidden;
}

.usage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.sidebar-security-details {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.sidebar-security-details div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-security-details strong {
  color: #344054;
  font-weight: 800;
  text-align: right;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 170px 210px auto;
  align-items: center;
  gap: 14px;
  min-height: 94px;
  padding: 22px 28px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  cursor: default;
}

.topbar,
.topbar * {
  cursor: default !important;
}

.topbar button:disabled {
  cursor: default;
  pointer-events: none;
}

.search-wrap {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.search-icon {
  color: #475467;
  font-size: 24px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.search-wrap .search-input {
  height: 46px;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.search-wrap .search-input:focus {
  box-shadow: none;
}

.shortcut {
  min-width: 42px;
  border-radius: 8px;
  padding: 5px 8px;
  background: #f2f4f7;
  color: #667085;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  user-select: none;
}

.toolbar-select {
  height: 48px;
  color: #344054;
  font-weight: 650;
  box-shadow: var(--shadow-soft);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 26px 28px 36px;
}

.fab-add {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 30;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 16px 34px rgba(29, 92, 255, .28);
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.fab-add:hover {
  background: var(--accent-dark);
  box-shadow: 0 18px 38px rgba(29, 92, 255, .34);
  transform: translateY(-1px);
}

.fab-add:focus-visible {
  outline: 3px solid rgba(29, 92, 255, .22);
  outline-offset: 3px;
}

.content-area {
  min-width: 0;
}

.content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.content-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.content-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.head-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-pill {
  border: 1px solid #bfe8d3;
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.mode-pill.edit {
  border-color: #f5d894;
  background: var(--amber-soft);
  color: var(--amber);
}

.tag-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.tag-strip:empty {
  display: none;
}

.tag-chip {
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  box-shadow: 0 3px 10px rgba(16, 24, 40, .035);
}

.tag-chip.active {
  border-color: rgba(29, 92, 255, .3);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 18px;
  align-items: start;
}

.otp-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 190px;
  display: grid;
  gap: 12px;
  align-content: start;
  box-shadow: var(--shadow-soft);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.otp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(16, 24, 40, .10);
  border-color: var(--line-strong);
}

.otp-card.dragging {
  opacity: .55;
  transform: scale(.99);
  cursor: grabbing;
}

.otp-card.drop-target {
  outline: 2px solid rgba(29, 92, 255, .46);
  outline-offset: 2px;
  border-color: rgba(29, 92, 255, .42);
}

.drag-handle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: #fff;
  color: #98a2b3;
  cursor: grab;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  user-select: none;
  touch-action: none;
  -webkit-user-drag: none;
}

.drag-handle:hover {
  border-color: #cfd6e2;
  background: #f7f9fc;
  color: var(--accent);
}

.drag-handle:active {
  cursor: grabbing;
}

.otp-card.deleted {
  background: #fbfcff;
  border-style: dashed;
}

.card-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 44px;
}

.issuer-badge {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 10px 20px rgba(16, 24, 40, .12);
  transition: box-shadow .15s ease, transform .15s ease, outline-color .15s ease;
}

button.issuer-badge {
  padding: 0;
}

.issuer-badge.editable {
  cursor: pointer;
}

.issuer-badge.editable:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(16, 24, 40, .16);
}

.issuer-badge.has-icon .ui-icon {
  width: 23px;
  height: 23px;
  stroke-width: 2.15;
}

.card-title {
  min-width: 0;
}

.card-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: max-content;
}

.avatar-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  margin-bottom: 16px;
}

.avatar-preview .issuer-badge {
  flex: 0 0 auto;
  pointer-events: none;
}

.avatar-preview strong {
  display: block;
  color: #1f2937;
  margin-bottom: 4px;
}

.avatar-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.card-title h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav,
.copy-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #98a2b3;
  font-size: 17px;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
}

.fav:hover,
.copy-btn:hover {
  border-color: #cfd6e2;
  background: #f7f9fc;
  color: var(--accent);
}

.fav.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #c7d7ff;
}

.fav.disabled {
  display: grid;
  place-items: center;
  color: #98a2b3;
  background: #f2f4f7;
}

.copy-btn.copied {
  border-color: #bfe8d3;
  background: var(--success-soft);
  color: var(--success);
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
  min-height: 42px;
}

.otp-code {
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: clamp(30px, 2.15vw, 40px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  color: #101828;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
}

.seconds {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.progress {
  height: 5px;
  border-radius: 999px;
  background: #edf1f6;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}

.small-tag {
  border-radius: 999px;
  padding: 4px 9px;
  background: #f2f4f7;
  color: #667085;
  font-size: 12px;
}

.group-tag {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.trash-tag {
  background: #fff4e5;
  color: #9a5b00;
}

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

.card-actions:empty {
  display: none;
}

.card-actions .primary,
.card-actions .secondary,
.card-actions .danger {
  min-height: 34px;
  padding-inline: 12px;
  box-shadow: none;
}

.right-rail {
  display: grid;
  align-content: start;
  gap: 24px;
}

.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.side-card-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.shield-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 2px solid #97dfbc;
  background: var(--success-soft);
  color: var(--success);
  font-size: 26px;
  font-weight: 900;
}

.side-card-head p {
  margin: 0 0 4px;
  color: var(--muted);
  font-weight: 700;
}

.side-card-head strong {
  display: block;
  color: var(--success);
  font-size: 25px;
}

.secure-chip {
  display: inline-flex;
  margin-top: 16px;
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 800;
  font-size: 13px;
}

.side-note {
  margin: 12px 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.side-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.side-meta strong {
  color: #344054;
}

.side-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.side-title-row h3 {
  margin: 0;
  font-size: 17px;
}

.link-btn {
  border-radius: 8px;
  padding: 6px 8px;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.link-btn:hover {
  background: var(--accent-soft);
}

.audit-preview-list {
  display: grid;
}

.audit-preview-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.audit-preview-row:first-child {
  border-top: 0;
}

.audit-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  margin-top: 2px;
  border: 2px solid #a7d8ff;
  background: #edf7ff;
}

.audit-preview-row strong {
  display: block;
  color: #344054;
  font-size: 14px;
  line-height: 1.3;
}

.audit-preview-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-preview-row time {
  color: var(--muted-2);
  font-size: 12px;
  white-space: nowrap;
}

.audit-preview-empty {
  border-top: 1px solid var(--line);
  padding: 18px 0 4px;
  color: var(--muted);
  text-align: center;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed #bdc7d5;
  border-radius: 8px;
  padding: 46px 18px;
  background: #fff;
  text-align: center;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, .42);
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(5px);
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface-soft);
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 18px;
}

.qr-zone {
  border: 1px dashed #aebbd0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
  min-height: 104px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.qr-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.video-box {
  width: 100%;
  max-height: 280px;
  border-radius: 8px;
  background: #0f172a;
  display: none;
}

.video-box.active {
  display: block;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.audit-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.audit-row strong {
  display: inline-block;
  margin-right: 8px;
}

.audit-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 12px 14px;
  background: #101828;
  color: #fff;
  box-shadow: var(--shadow);
}

.toast.error {
  background: #991b1b;
}

.highlight {
  background: #fff1a8;
  border-radius: 4px;
}

@media (max-width: 1280px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .topbar {
    grid-template-columns: 1fr 170px 210px;
  }

  .actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .topbar,
  .content-grid {
    padding-inline: 14px;
  }

  .topbar {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 10px;
  }

  .fab-add {
    right: 16px;
    bottom: 16px;
    width: 50px;
    height: 50px;
  }

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

  .head-tools,
  .actions {
    justify-content: flex-start;
  }

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

  .icon-picker {
    grid-template-columns: repeat(4, 42px);
  }

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

  .otp-code {
    font-size: 32px;
  }
}
