:root {
  --bg-app: #f5f7fb;
  --bg-surface: #ffffff;
  --bg-surface-2: #f9fbff;
  --text-strong: #1f2a37;
  --text-muted: #5f6b7a;
  --line-soft: #dfe6ef;
  --line-focus: #5c86ff;
  --primary: #2f6bff;
  --primary-strong: #1e57e8;
  --danger: #e34d64;
  --success: #1f9d61;
  --warn: #c5851f;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-soft: 0 10px 28px rgba(31, 42, 55, 0.08);
  --shadow-lift: 0 14px 26px rgba(47, 107, 255, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text-strong);
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(700px 460px at -5% -12%, rgba(47, 107, 255, 0.14) 0%, transparent 62%),
    radial-gradient(640px 380px at 106% 5%, rgba(64, 188, 146, 0.12) 0%, transparent 60%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg-app) 100%);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.01em;
  color: #1a2433;
}

p {
  margin: 0;
}

.bg-orb,
.bg-grid {
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

.bg-orb {
  width: 42vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.33;
}

.orb-a {
  top: -18vmax;
  left: -16vmax;
  background: #9ec2ff;
}

.orb-b {
  right: -16vmax;
  bottom: -20vmax;
  background: #b7f0df;
}

.bg-grid {
  inset: 0;
  background-image:
    linear-gradient(rgba(24, 39, 64, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 39, 64, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 34%, transparent 85%);
}

.hidden {
  display: none !important;
}

.layout {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 7rem;
}

.topbar {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  width: min(1200px, calc(100% - 2rem));
  margin: 0.75rem auto 1.2rem;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand h1 {
  font-size: 1.26rem;
}

.brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #82a8ff, #5bd4b2);
  box-shadow: 0 0 0 6px rgba(130, 168, 255, 0.16);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.glass {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(223, 230, 239, 0.92);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.panel {
  padding: 1.25rem;
  overflow: hidden;
}

.admin-only {
  position: relative;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem;
  margin-bottom: 1.1rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: #eef3fb;
  color: #294061;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 700;
  font-family: "Manrope", sans-serif;
  transition: transform 160ms ease, box-shadow 180ms ease, background 180ms ease;
}

.tab:hover {
  background: #e6edf9;
}

.tab.active {
  background: linear-gradient(135deg, #2f6bff, #3e7dff);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(47, 107, 255, 0.28);
}

.view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.full-width {
  grid-column: 1 / -1;
}

.stat-card {
  text-align: left;
}

.label {
  color: var(--text-muted);
  margin-bottom: 0.55rem;
  font-size: 0.92rem;
}

.stat-card h3 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.bank-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.95rem;
}

.stat-chip {
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: var(--bg-surface-2);
}

.stat-chip h3 {
  font-size: clamp(1.4rem, 3.5vw, 1.95rem);
}

.profile-form {
  max-width: 740px;
}

.profile-inspector {
  margin-bottom: 1rem;
  background: #fbfdff;
}

.profile-inspector-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.35rem;
}

.avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  background: #f2f5fb;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.list-item {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--line-soft);
  display: grid;
  gap: 0.4rem;
  overflow-wrap: anywhere;
}

.list-item.clickable {
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.list-item.clickable:hover {
  border-color: #b8cbeb;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(47, 107, 255, 0.08);
}

.list-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.list-item-head > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.list-item-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.45rem;
}

.muted {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.amount-positive {
  color: var(--success);
  font-weight: 800;
}

.amount-negative {
  color: var(--danger);
  font-weight: 800;
}

.amount-neutral {
  color: var(--text-muted);
}

.status-pill {
  display: inline-block;
  padding: 0.18rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: #f6f9ff;
}

.status-good {
  color: var(--success);
  border-color: rgba(31, 157, 97, 0.35);
}

.status-warn {
  color: var(--warn);
  border-color: rgba(197, 133, 31, 0.35);
}

.status-danger {
  color: var(--danger);
  border-color: rgba(227, 77, 100, 0.35);
}

.stack {
  display: grid;
  gap: 0.95rem;
}

.row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--text-strong);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-soft);
  background: var(--bg-surface);
  color: var(--text-strong);
  border-radius: 12px;
  padding: 0.82rem 0.92rem;
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #90a0b4;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--line-focus);
  box-shadow: 0 0 0 4px rgba(92, 134, 255, 0.14);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  font-weight: 800;
  font-family: "Manrope", sans-serif;
  transition: transform 120ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #ffffff;
  box-shadow: var(--shadow-lift);
}

.btn-tonal {
  background: #ecf2ff;
  border-color: #cfddf9;
  color: #2d4b77;
}

.btn-danger {
  background: #fff2f4;
  border-color: #f7cdd5;
  color: #b43a4f;
}

.btn-ghost {
  background: #f5f7fb;
  border-color: #dce3ed;
  color: #4b5b70;
}

.fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 56px;
  height: 56px;
  border: 1px solid #c8d9f6;
  border-radius: 18px;
  font-size: 1.22rem;
  font-weight: 800;
  background: linear-gradient(145deg, #edf3ff, #e2f7f1);
  color: #294061;
  box-shadow: 0 10px 22px rgba(31, 42, 55, 0.16);
  cursor: pointer;
}

.fab-install {
  bottom: 5rem;
  width: auto;
  min-width: 56px;
  padding: 0 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 30;
  color: #ffffff;
  background: rgba(35, 51, 75, 0.94);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  box-shadow: 0 10px 20px rgba(20, 32, 50, 0.34);
}

.animate-in {
  animation: rise 320ms cubic-bezier(0.18, 0.85, 0.25, 1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html,
body,
.view-grid,
.list,
.list-item {
  contain: layout style paint;
}

@media (min-width: 760px) {
  .layout {
    padding-inline: 1.4rem;
  }

  .topbar {
    width: min(1200px, calc(100% - 2.4rem));
  }

  .view-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dashboard-view {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bank-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 759px) {
  .topbar {
    padding: 0.85rem 0.95rem;
  }

  .panel {
    padding: 1rem;
  }

  .btn {
    padding: 0.72rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
