/* =========================================================================
   MOEVAULT // SCHALE CREDENTIAL ARCHIVE — ANIME TACTICAL HUD STYLESHEET
   ========================================================================= */

:root {
  /* Light Mode: Schale Academy Luminous Sky Palette */
  --bg-primary: #EEF5FF;
  --bg-secondary: #E2EEFF;
  --surface-glass: rgba(255, 255, 255, 0.86);
  --surface-solid: #FFFFFF;
  --surface-muted: rgba(240, 247, 255, 0.92);
  --surface-hover: rgba(18, 137, 248, 0.06);
  --surface-code: #0E182E;

  --text-primary: #1A2B4C;
  --text-secondary: #4A608A;
  --text-muted: #7B90B6;
  --text-on-accent: #FFFFFF;

  --schale-blue: #1289F8;
  --schale-blue-hover: #0B72D6;
  --schale-cyan: #00D2FF;
  --halo-pink: #FF5E8E;
  --halo-gold: #F59E0B;
  --halo-emerald: #10B981;
  --halo-danger: #EF4444;

  --border-light: rgba(18, 137, 248, 0.16);
  --border-strong: rgba(18, 137, 248, 0.34);
  --shadow-card: 0 10px 30px -6px rgba(18, 65, 145, 0.08), 0 4px 12px -2px rgba(18, 137, 248, 0.05);
  --shadow-hover: 0 18px 36px -8px rgba(18, 137, 248, 0.18), 0 0 0 1px rgba(0, 210, 255, 0.35);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --font-sans: 'Plus Jakarta Sans', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html[data-theme="dark"] {
  /* Dark Mode: Starry Kivotos Night Mode */
  --bg-primary: #0B1326;
  --bg-secondary: #0F1B35;
  --surface-glass: rgba(19, 32, 60, 0.86);
  --surface-solid: #152342;
  --surface-muted: rgba(24, 41, 76, 0.88);
  --surface-hover: rgba(0, 210, 255, 0.09);
  --surface-code: #070D1B;

  --text-primary: #E8F1FF;
  --text-secondary: #9DB4DC;
  --text-muted: #657FA8;

  --border-light: rgba(0, 210, 255, 0.18);
  --border-strong: rgba(0, 210, 255, 0.42);
  --shadow-card: 0 12px 34px -6px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 210, 255, 0.12);
  --shadow-hover: 0 18px 40px -6px rgba(0, 210, 255, 0.22), 0 0 14px rgba(0, 210, 255, 0.25);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  transition: background 0.25s ease, color 0.25s ease;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
}

/* =========================================================================
   AMBIENT ANIME HUD BACKGROUND
   ========================================================================= */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(rgba(18, 137, 248, 0.15) 1px, transparent 1px),
    linear-gradient(to right, rgba(18, 137, 248, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(18, 137, 248, 0.04) 1px, transparent 1px);
  background-size: 24px 24px, 96px 96px, 96px 96px;
}

.bg-halo-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.orb-1 {
  width: 460px;
  height: 460px;
  top: -140px;
  right: -100px;
  background: radial-gradient(circle, var(--schale-cyan), transparent 70%);
}

.orb-2 {
  width: 420px;
  height: 420px;
  bottom: -140px;
  left: -120px;
  background: radial-gradient(circle, var(--halo-pink), transparent 70%);
}

/* Frosted Glass Panel Base */
.glass-panel {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* =========================================================================
   SLANTED ANIME PARALLELOGRAM TAGS & BADGES
   ========================================================================= */
.skew-tag,
.skew-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: skewX(-10deg);
  border-radius: 4px;
  white-space: nowrap;
}

.tag-blue, .badge-cyan {
  background: linear-gradient(90deg, var(--schale-blue), var(--schale-cyan));
  color: #FFFFFF;
}

.tag-pink, .badge-pink {
  background: linear-gradient(90deg, var(--halo-pink), #FF85A9);
  color: #FFFFFF;
}

.tag-cyan {
  background: rgba(0, 210, 255, 0.16);
  color: var(--schale-blue);
  border: 1px solid rgba(0, 210, 255, 0.4);
}

html[data-theme="dark"] .tag-cyan {
  color: var(--schale-cyan);
}

.tag-safe {
  background: rgba(16, 185, 129, 0.15);
  color: var(--halo-emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.tag-danger {
  background: rgba(239, 68, 68, 0.16);
  color: var(--halo-danger);
  border: 1px solid rgba(239, 68, 68, 0.38);
}

.tag-gold {
  background: rgba(245, 158, 11, 0.16);
  color: var(--halo-gold);
  border: 1px solid rgba(245, 158, 11, 0.38);
}

/* =========================================================================
   AUTH / SETUP OVERLAY
   ========================================================================= */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(11, 19, 38, 0.55);
  backdrop-filter: blur(18px);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 30px 32px 34px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
}

.hud-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--schale-cyan);
  border-style: solid;
  pointer-events: none;
}
.hud-tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.hud-tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.hud-bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; }
.hud-br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.auth-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--border-light);
}

.hud-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--schale-blue);
  letter-spacing: 0.05em;
}

.hud-dots {
  display: flex;
  gap: 5px;
}
.hud-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--schale-cyan);
}
.hud-dots span:nth-child(2) { background: var(--schale-blue); }
.hud-dots span:nth-child(3) { background: var(--halo-pink); }

.auth-mascot-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 12px;
}

.schale-mascot-svg {
  width: 240px;
  height: 138px;
}

.floating-halo {
  animation: haloFloat 3.4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes haloFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

.auth-view {
  text-align: center;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 10px 0 6px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.auth-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* =========================================================================
   MAIN SHELL & TOP TACTICAL HEADER
   ========================================================================= */
.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  border-top: 3px solid var(--schale-blue);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-emblem {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(18, 137, 248, 0.14), rgba(255, 94, 142, 0.14));
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-halo-svg {
  width: 42px;
  height: 42px;
}

.brand-hud-overline,
.hud-overline {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--schale-blue);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

html[data-theme="dark"] .brand-hud-overline,
html[data-theme="dark"] .hud-overline {
  color: var(--schale-cyan);
}

.brand-main-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-name {
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--schale-blue), var(--halo-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Main Navigation Tabs */
.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-align: left;
}

.nav-tab:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.nav-tab.active {
  background: linear-gradient(135deg, var(--schale-blue), #00B4FF);
  color: #FFFFFF;
  box-shadow: 0 6px 18px -4px rgba(18, 137, 248, 0.45);
}

.nav-tab-icon {
  font-size: 1.15rem;
}

.nav-tab-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.nav-tab-cn {
  font-size: 0.88rem;
  font-weight: 700;
}

.nav-tab-en {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  opacity: 0.8;
  letter-spacing: 0.04em;
}

.nav-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(255, 94, 142, 0.2);
  color: var(--halo-pink);
}

.nav-tab.active .nav-pill {
  background: rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
}

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

/* =========================================================================
   STATS RIBBON
   ========================================================================= */
.stats-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  position: relative;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.stat-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.accent-blue { background: var(--schale-blue); }
.accent-cyan { background: var(--schale-cyan); }
.accent-pink { background: var(--halo-pink); }
.accent-gold { background: var(--halo-gold); }

.stat-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.stat-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--schale-blue);
}

html[data-theme="dark"] .stat-value {
  color: var(--schale-cyan);
}

.stat-breakdown {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-breakdown .sep {
  color: var(--text-muted);
}

.stat-row-val {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* =========================================================================
   TOOLBARS, INPUTS, BUTTONS & FILTER PILLS
   ========================================================================= */
.toolbar-panel {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--border-light);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-pill:hover {
  border-color: var(--schale-blue);
  color: var(--schale-blue);
}

.filter-pill.active {
  background: linear-gradient(90deg, var(--schale-blue), var(--schale-cyan));
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(18, 137, 248, 0.3);
}

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

.toolbar-controls.full-width {
  width: 100%;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 280px;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 0.9rem;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 9px 32px 9px 36px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--surface-solid);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.86rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--schale-blue);
  box-shadow: 0 0 0 3px rgba(18, 137, 248, 0.16);
}

.search-box .icon-btn {
  position: absolute;
  right: 6px;
}

.select-input,
.text-input-sm,
input[type="text"],
input[type="password"],
input[type="url"],
.textarea-input {
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--surface-solid);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.86rem;
}

.full-width {
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--schale-blue), #00B4FF);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(18, 137, 248, 0.32);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(18, 137, 248, 0.45);
}

.btn-secondary {
  background: var(--surface-muted);
  color: var(--schale-blue);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .btn-secondary {
  color: var(--schale-cyan);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--halo-danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--halo-danger);
  color: #FFFFFF;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-light);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 0.74rem;
  border-radius: 7px;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 0.95rem;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.86rem;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--schale-blue);
  border-color: var(--border-light);
}

/* =========================================================================
   V2 POLICY STRIP & CREDENTIAL CARDS GRID
   ========================================================================= */
.v2-policy-strip {
  margin-top: 12px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-left: 4px solid var(--schale-cyan);
}

.v2-strip-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.v2-roadmap-pill {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(18, 137, 248, 0.1);
  color: var(--schale-blue);
  border: 1px dashed var(--border-strong);
}

html[data-theme="dark"] .v2-roadmap-pill {
  color: var(--schale-cyan);
}

.credentials-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

/* Individual Credential Card */
.cred-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cred-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}

.cred-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.cred-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cred-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--schale-blue), var(--schale-cyan));
  box-shadow: 0 4px 10px rgba(18, 137, 248, 0.25);
}

.cred-avatar.avatar-card {
  background: linear-gradient(135deg, #6366F1, var(--halo-pink));
}

.cred-avatar.avatar-custom {
  background: linear-gradient(135deg, #10B981, #06B6D4);
}

.cred-title-wrap {
  min-width: 0;
}

.cred-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cred-title-text {
  font-size: 1.02rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-star {
  color: var(--halo-gold);
  font-size: 0.95rem;
}

.cred-sub-url {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--schale-blue);
  text-decoration: none;
  max-width: 230px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cred-sub-url:hover {
  text-decoration: underline;
}

/* Secret Field Rows (for Login & Custom Credentials) */
.secret-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px;
}

.secret-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--surface-muted);
  border: 1px solid var(--border-light);
}

.secret-field-meta {
  min-width: 0;
  flex: 1;
}

.secret-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.secret-value {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.secret-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

/* Type 2: Sleek Holographic Payment Card Visual */
.holo-bank-card {
  position: relative;
  padding: 16px 18px;
  border-radius: 14px;
  margin: 6px 0 12px;
  color: #FFFFFF;
  background: linear-gradient(135deg, #162B5B 0%, #1289F8 55%, #FF5E8E 100%);
  box-shadow: 0 8px 22px -4px rgba(18, 137, 248, 0.38);
  overflow: hidden;
}

.holo-bank-card::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
  pointer-events: none;
}

.holo-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.holo-chip {
  width: 32px;
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, #FDE68A, #F59E0B);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.holo-brand {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.18);
}

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

.holo-number {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.holo-card-actions .icon-btn {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.16);
  width: 26px;
  height: 26px;
}

.holo-card-actions .icon-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.holo-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
}

.holo-col-label {
  font-size: 0.6rem;
  opacity: 0.78;
  text-transform: uppercase;
}

.holo-col-val {
  font-size: 0.8rem;
  font-weight: 700;
}

.holo-ccv-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Card Tags, Notes, V2 Status Pill & Footer Actions */
.cred-tags-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tag-chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(18, 137, 248, 0.1);
  color: var(--schale-blue);
  cursor: pointer;
}

html[data-theme="dark"] .tag-chip {
  color: var(--schale-cyan);
}

.cred-notes-preview {
  font-size: 0.79rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cred-card-footer {
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.v2-mini-pill {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-muted);
}

.cred-footer-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* =========================================================================
   TAB 2: AUDIT TRAIL TABLE & BADGES
   ========================================================================= */
.section-header {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 4px 0;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.audit-table-container {
  margin-top: 14px;
  overflow-x: auto;
  padding: 6px;
}

.schale-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.schale-table th {
  text-align: left;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-light);
  white-space: nowrap;
}

.schale-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.schale-table tbody tr:hover {
  background: var(--surface-hover);
}

.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(18, 137, 248, 0.16), rgba(0, 210, 255, 0.16));
  color: var(--schale-blue);
  border: 1px solid rgba(18, 137, 248, 0.35);
}

html[data-theme="dark"] .model-badge {
  color: var(--schale-cyan);
}

.purpose-highlight {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 94, 142, 0.09);
  border-left: 3px solid var(--halo-pink);
  font-weight: 600;
  color: var(--text-primary);
}

/* =========================================================================
   TAB 3: MCP ACCESS, PERMISSIONS & AGENT KEYS
   ========================================================================= */
.mcp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.mcp-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-panel {
  padding: 20px 22px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.panel-header h3 {
  font-size: 1.08rem;
  font-weight: 800;
  margin-top: 2px;
}

.panel-note {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.permission-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.permission-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border-light);
}

.permission-danger {
  border-left: 4px solid var(--halo-pink);
  background: rgba(255, 94, 142, 0.05);
}

.perm-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.perm-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Toggle Switch */
.schale-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.schale-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(123, 144, 182, 0.35);
  transition: 0.25s;
  border-radius: 34px;
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: #FFFFFF;
  transition: 0.25s;
  border-radius: 50%;
}

.schale-switch input:checked + .switch-slider {
  background: linear-gradient(90deg, var(--schale-blue), var(--schale-cyan));
}

.permission-danger .schale-switch input:checked + .switch-slider {
  background: linear-gradient(90deg, var(--halo-pink), var(--halo-danger));
}

.schale-switch input:checked + .switch-slider::before {
  transform: translateX(22px);
}

/* Agent Keys List */
.inline-create-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-keys-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.key-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.key-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-token-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-solid);
  border: 1px solid var(--border-light);
  color: var(--schale-blue);
}

html[data-theme="dark"] .key-token-code {
  color: var(--schale-cyan);
}

.key-stats-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
}

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

/* Code Snippets */
.snippet-block {
  margin-top: 14px;
}

.snippet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.snippet-title {
  font-size: 0.82rem;
  font-weight: 700;
}

.code-box {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-code);
  color: #E2E8F0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  overflow-x: auto;
  line-height: 1.55;
  border: 1px solid rgba(0, 210, 255, 0.22);
}

.mcp-contract-card {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(18, 137, 248, 0.08);
  border: 1px dashed var(--border-strong);
  font-size: 0.81rem;
}

.contract-title {
  font-weight: 800;
  color: var(--schale-blue);
  margin-bottom: 6px;
}

html[data-theme="dark"] .contract-title {
  color: var(--schale-cyan);
}

.mcp-contract-card ul {
  margin-top: 6px;
  padding-left: 18px;
}

/* =========================================================================
   TAB 4: CSV DROPZONE & EXPORT CARDS
   ========================================================================= */
.csv-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  background: var(--surface-muted);
  cursor: pointer;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.csv-dropzone:hover,
.csv-dropzone.dragover {
  border-color: var(--schale-blue);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.dropzone-icon {
  font-size: 2.1rem;
  margin-bottom: 6px;
}

.dropzone-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.dropzone-sub {
  font-size: 0.79rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.import-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.export-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border-light);
}

.export-item h4 {
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.export-item p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* =========================================================================
   MODALS & FORMS
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(11, 19, 38, 0.58);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px 26px;
  border: 1px solid var(--border-strong);
}

.modal-sm {
  max-width: 460px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.input-with-action {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-with-action input {
  flex: 1;
}

/* Credential Type Selector in Modal */
.type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.type-option {
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--surface-muted);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: inherit;
  transition: all 0.18s ease;
}

.type-option.active {
  border-color: var(--schale-blue);
  background: rgba(18, 137, 248, 0.12);
  box-shadow: 0 0 0 2px rgba(18, 137, 248, 0.25);
}

.type-icon {
  font-size: 1.35rem;
}

.type-name {
  font-size: 0.86rem;
  font-weight: 800;
}

.type-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.cred-type-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border-light);
}

.custom-fields-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.custom-fields-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-kv-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  gap: 8px;
  align-items: center;
}

.modal-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 12px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* History Version List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.welcome-key-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-code);
  color: var(--schale-cyan);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  word-break: break-all;
}

/* Empty State */
.empty-state {
  margin-top: 16px;
  padding: 44px 24px;
  text-align: center;
}

.empty-mascot-svg {
  width: 190px;
  height: 112px;
  margin-bottom: 10px;
}

.empty-state h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 18px;
}

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

.empty-state-inline {
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-item {
  min-width: 260px;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface-solid);
  color: var(--text-primary);
  border-left: 4px solid var(--schale-blue);
  box-shadow: var(--shadow-hover);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: toastSlideIn 0.22s ease-out;
}

.toast-item.toast-error {
  border-left-color: var(--halo-danger);
}

.toast-item.toast-success {
  border-left-color: var(--halo-emerald);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================= */
@media (max-width: 1080px) {
  .stats-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }
  .mcp-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px 12px 48px;
  }
  .top-header {
    flex-direction: column;
    align-items: stretch;
  }
  .stats-ribbon {
    grid-template-columns: 1fr;
  }
  .form-row-2,
  .form-row-3,
  .type-selector {
    grid-template-columns: 1fr;
  }
  .hide-mobile {
    display: none;
  }
  .credentials-grid {
    grid-template-columns: 1fr;
  }
}
