/* ==========================================================================
   Excels Tech Demo Portal - design system
   ========================================================================== */

:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --brand-1: #6366f1;
  --brand-2: #22d3ee;
  --brand-3: #a855f7;

  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #f43f5e;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Dark (default) ---- */
[data-theme="dark"] {
  --bg: #070a16;
  --bg-soft: #0c1122;
  --surface: rgba(20, 26, 48, 0.72);
  --surface-solid: #141a30;
  --surface-hover: rgba(28, 36, 64, 0.9);
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #eef2ff;
  --text-muted: #9aa6c4;
  --text-dim: #6b7799;
  --field: rgba(9, 13, 28, 0.7);
  --shadow: 0 24px 60px -24px rgba(2, 6, 23, 0.9);
  --shadow-sm: 0 10px 24px -14px rgba(2, 6, 23, 0.8);
  --glow-1: rgba(99, 102, 241, 0.32);
  --glow-2: rgba(34, 211, 238, 0.2);
  --chip: rgba(99, 102, 241, 0.14);
  --accent-wash: rgba(99, 102, 241, 0.12);
}

/* ---- Light ---- */
[data-theme="light"] {
  --bg: #f4f6fc;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-hover: #f8fafc;
  --line: rgba(15, 23, 42, 0.09);
  --line-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --text-muted: #55627d;
  --text-dim: #7b87a1;
  --field: #ffffff;
  --shadow: 0 24px 50px -26px rgba(15, 23, 42, 0.28);
  --shadow-sm: 0 10px 22px -14px rgba(15, 23, 42, 0.22);
  --glow-1: rgba(99, 102, 241, 0.18);
  --glow-2: rgba(34, 211, 238, 0.14);
  --chip: rgba(99, 102, 241, 0.1);
  --accent-wash: rgba(99, 102, 241, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

::selection {
  background: rgba(99, 102, 241, 0.35);
}

/* ---- Ambient background ---- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(
      1200px 600px at 12% -10%,
      var(--glow-1),
      transparent 60%
    ),
    radial-gradient(900px 500px at 88% 0%, var(--glow-2), transparent 60%),
    var(--bg);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.7;
}

.glow--one {
  width: 460px;
  height: 460px;
  top: -140px;
  left: -120px;
  background: var(--glow-1);
}

.glow--two {
  width: 520px;
  height: 520px;
  bottom: -200px;
  right: -140px;
  background: var(--glow-2);
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(
    ellipse at 50% 0%,
    #000 20%,
    transparent 75%
  );
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
  opacity: 0.5;
}

/* ==========================================================================
   Shared atoms
   ========================================================================== */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.5px;
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.8);
  flex: none;
}

.brand__name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.brand__sub {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.2;
}

.btn {
  --btn-bg: var(--surface-solid);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s var(--ease), border-color 0.18s var(--ease);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand-1), #4f46e5 55%, var(--brand-3));
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(79, 70, 229, 0.9);
}

.btn--primary:hover {
  box-shadow: 0 18px 36px -14px rgba(79, 70, 229, 1);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-muted);
}

.btn--ghost:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.btn--block {
  width: 100%;
}

.btn--lg {
  padding: 14px 18px;
  font-size: 15px;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.18s var(--ease), background 0.18s var(--ease),
    border-color 0.18s var(--ease);
  flex: none;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field__label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: 0.2px;
}

.field__wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field__icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--text-dim);
  pointer-events: none;
}

.input {
  width: 100%;
  padding: 13px 14px 13px 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--field);
  color: var(--text);
  font-size: 14.5px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.input::placeholder {
  color: var(--text-dim);
}

.input:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
}

.input--bare {
  padding-left: 14px;
}

.field__toggle {
  position: absolute;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  padding: 7px;
  border-radius: 7px;
  display: grid;
  place-items: center;
}

.field__toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.field__toggle svg {
  width: 17px;
  height: 17px;
}

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
  border: 1px solid;
}

.alert svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 1px;
}

.alert--error {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.34);
  color: #fda4af;
}

.alert--info {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.32);
  color: #6ee7b7;
}

[data-theme="light"] .alert--error {
  color: #b91c3c;
}

[data-theme="light"] .alert--info {
  color: #047857;
}

/* ==========================================================================
   Login
   ========================================================================== */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: stretch;
}

.auth__aside {
  position: relative;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: linear-gradient(
      150deg,
      rgba(99, 102, 241, 0.92),
      rgba(14, 116, 144, 0.9)
    ),
    #0b1024;
  color: #fff;
}

.auth__aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
      circle at 20% 20%,
      rgba(255, 255, 255, 0.14),
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(255, 255, 255, 0.1),
      transparent 45%
    );
  pointer-events: none;
}

.auth__aside > * {
  position: relative;
  z-index: 1;
}

.auth__aside .brand__mark {
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

.auth__aside .brand__sub {
  color: rgba(255, 255, 255, 0.7);
}

.auth__headline {
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -1.2px;
  margin: 0 0 16px;
  max-width: 15ch;
}

.auth__lede {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.82);
  max-width: 42ch;
  margin: 0 0 32px;
}

.auth__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  max-width: 46ch;
}

.auth__features li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.9);
}

.auth__features svg {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
  color: #a5f3fc;
}

.auth__stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.auth__stat b {
  display: block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.auth__stat span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.68);
}

.auth__main {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.auth__card {
  width: 100%;
  max-width: 420px;
  padding: 36px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.auth__card h2 {
  margin: 0 0 6px;
  font-size: 25px;
  letter-spacing: -0.6px;
  font-weight: 700;
}

.auth__card p.sub {
  margin: 0 0 26px;
  color: var(--text-muted);
  font-size: 14px;
}

.auth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 22px;
  font-size: 13.5px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-1);
  cursor: pointer;
}

.auth__hint {
  margin: 22px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-dim);
  text-align: center;
}

.auth__theme {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 5;
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ==========================================================================
   Dashboard shell
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

@supports (background: color-mix(in srgb, red 50%, blue)) {
  .topbar {
    background: color-mix(in srgb, var(--bg) 78%, transparent);
  }
}

.topbar__search {
  position: relative;
  flex: 1;
  max-width: 460px;
  margin-left: auto;
}

.topbar__search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.topbar__search input {
  width: 100%;
  padding: 10px 60px 10px 38px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  color: var(--text);
  font-size: 14px;
}

.topbar__search input:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.topbar__search kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
  background: var(--surface);
  pointer-events: none;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-menu {
  position: relative;
}

.user-menu__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s var(--ease);
}

.user-menu__trigger:hover {
  border-color: var(--line-strong);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-3), var(--brand-1));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

.user-menu__name {
  font-size: 13.5px;
  font-weight: 600;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 250px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}

.user-menu[data-open="true"] .user-menu__panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.user-menu__head {
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.user-menu__head strong {
  display: block;
  font-size: 14px;
}

.user-menu__head span {
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.menu-item:hover {
  background: var(--chip);
  color: var(--text);
}

.menu-item svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.menu-item--danger {
  color: #fb7185;
}

.menu-item--danger:hover {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
}

/* ---- Page ---- */
.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 28px 72px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -1px;
  font-weight: 800;
}

.hero p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  max-width: 58ch;
}

.stat-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat {
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  min-width: 120px;
}

.stat b {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.stat span {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  font-weight: 600;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.filter {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease),
    background 0.18s var(--ease);
}

.filter:hover {
  color: var(--text);
  border-color: var(--brand-1);
}

.filter[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--brand-1), #4f46e5);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(79, 70, 229, 0.9);
}

.toolbar__filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 240px;
}

.toolbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.result-count {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}

/* ==========================================================================
   App cards
   ========================================================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease),
    border-color 0.24s var(--ease);
  animation: rise 0.5s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  opacity: 0.9;
}

.app-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    460px 220px at 100% 0%,
    var(--accent-wash),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}

.app-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.app-card:hover::after {
  opacity: 1;
}

.app-card:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 3px;
}

.app-card__top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.app-card__logo {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.5px;
  flex: none;
  box-shadow: 0 12px 26px -14px var(--accent-from);
}

.app-card__head {
  min-width: 0;
  flex: 1;
}

.app-card__name {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.app-card__domain {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 3px;
  word-break: break-all;
}

.app-card__domain:hover {
  color: var(--brand-2);
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  flex: none;
}

.app-card__desc {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--text-muted);
  min-height: 40px;
}

.app-card__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.creds {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--field);
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.creds__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.creds__title svg {
  width: 13px;
  height: 13px;
}

.cred {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cred__label {
  width: 76px;
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cred__value {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-user-select: all;
  user-select: all;
}

.cred__value--masked {
  letter-spacing: 2px;
}

.cred__actions {
  display: flex;
  gap: 4px;
  flex: none;
}

.cred .icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.cred .icon-btn svg {
  width: 14px;
  height: 14px;
}

.app-card__foot {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.app-card__foot .btn--primary {
  flex: 1;
}

/* ---- Empty state ---- */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 70px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.empty svg {
  width: 44px;
  height: 44px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.empty h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 18px;
}

.empty p {
  margin: 0 0 18px;
  font-size: 14px;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 6, 18, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}

.modal[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.modal__card {
  width: 100%;
  max-width: 430px;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.22s var(--ease);
}

.modal[data-open="true"] .modal__card {
  transform: none;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.modal__head h3 {
  margin: 0 0 4px;
  font-size: 19px;
  letter-spacing: -0.4px;
}

.modal__head p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.modal__foot {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.modal__foot .btn {
  flex: 1;
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: grid;
  gap: 10px;
  justify-items: end;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  animation: toast-in 0.28s var(--ease) both;
  max-width: 340px;
}

.toast.is-out {
  animation: toast-out 0.24s var(--ease) both;
}

.toast svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.toast--ok svg {
  color: var(--ok);
}

.toast--err svg {
  color: var(--danger);
}

.toast--info svg {
  color: var(--brand-2);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(20px) scale(0.96);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth__aside {
    padding: 36px 28px;
  }
  .auth__features,
  .auth__stats {
    display: none;
  }
  .auth__headline {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px 16px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .topbar .brand__text {
    display: none;
  }
  .topbar__search {
    max-width: none;
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
  }
  .topbar__search kbd {
    display: none;
  }
  .topbar__search input {
    padding-right: 14px;
  }
  .topbar__actions {
    margin-left: auto;
  }
  .user-menu__name {
    display: none;
  }
  .page {
    padding: 24px 16px 56px;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .toasts {
    left: 16px;
    right: 16px;
    bottom: 16px;
    justify-items: stretch;
  }
  .toast {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Utility: make the hidden attribute win over component display rules. */
[hidden] {
  display: none !important;
}
