body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: radial-gradient(
      circle at top,
      rgba(90, 217, 255, 0.15),
      transparent 50%
    ),
    #040712;
  min-height: 100vh;
}

.noise {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Crect width='2' height='2'/%3E%3C/g%3E%3C/svg%3E");
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(4, 7, 18, 0.6), 0 0 40px rgba(93, 217, 255, 0.08);
}

/* Left branding panel */
.brand-panel {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(93, 217, 255, 0.08), rgba(99, 102, 241, 0.06));
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.brand-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(93, 217, 255, 0.12), transparent 50%);
  pointer-events: none;
}

.brand-logo {
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #5dd9ff, #2ab7ff, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.brand-tagline {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-top: 1rem;
  line-height: 1.6;
  max-width: 280px;
  position: relative;
  z-index: 1;
}

.brand-divider {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, #5dd9ff, transparent);
  margin: 1.5rem auto;
  border-radius: 1px;
  position: relative;
  z-index: 1;
}

.brand-subtitle {
  color: #5dd9ff;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* Right login panel */
.login-panel {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-panel h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
}

.login-panel .subtitle {
  color: #64748b;
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.form-group input::placeholder {
  color: #475569;
}

.form-group input:focus {
  border-color: rgba(93, 217, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(93, 217, 255, 0.1);
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.825rem;
}

.form-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #94a3b8;
  cursor: pointer;
}

.form-options label input[type="checkbox"] {
  accent-color: #5dd9ff;
  width: 14px;
  height: 14px;
}

.form-options a {
  color: #5dd9ff;
  text-decoration: none;
  transition: color 0.2s;
}

.form-options a:hover {
  color: #2ab7ff;
}

.btn-login {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #5dd9ff, #2ab7ff);
  color: #040712;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  letter-spacing: 0.02em;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(93, 217, 255, 0.3);
}

.btn-login:active {
  transform: translateY(0);
}

.signup-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: #64748b;
}

.signup-link a {
  color: #5dd9ff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.signup-link a:hover {
  color: #2ab7ff;
}

.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

/* Responsive */
@media (max-width: 768px) {
  .login-card {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: 1rem;
  }

  .brand-panel {
    padding: 2rem;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .login-panel {
    padding: 2rem;
  }
}

/* ===== Dashboard ===== */

.dash-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(4, 7, 18, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-logo {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #5dd9ff, #2ab7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dash-nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.dash-user {
  color: #94a3b8;
  font-size: 0.875rem;
}

.btn-logout {
  padding: 0.4rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.8rem;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.btn-logout:hover {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.dash-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 1.5rem 3rem;
}

/* Summary Cards */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  padding: 1.5rem;
  text-align: center;
}

.summary-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.summary-value {
  font-size: 2rem;
  font-weight: 700;
}

.summary-value.red { color: #f87171; }
.summary-value.green { color: #4ade80; }
.summary-value.aurora { color: #5dd9ff; }

/* Two Column Panels */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.dash-panel {
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  padding: 1.5rem;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.panel-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-title.green-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}

.panel-title.red-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f87171;
  display: inline-block;
}

.panel-hint {
  font-size: 0.75rem;
  color: #475569;
  font-weight: 400;
}

/* Empty State */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #475569;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.empty-state p {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.empty-state span {
  font-size: 0.8rem;
}

/* FAB Button */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #5dd9ff, #2ab7ff);
  color: #040712;
  font-size: 1.75rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(93, 217, 255, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(93, 217, 255, 0.45);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 7, 18, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 14, 28, 0.95);
  backdrop-filter: blur(20px);
  padding: 2rem;
  box-shadow: 0 25px 60px rgba(4, 7, 18, 0.7);
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #f1f5f9;
}

.modal-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #f1f5f9;
}

/* Select styling */
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  cursor: pointer;
}

.form-group select:focus {
  border-color: rgba(93, 217, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(93, 217, 255, 0.1);
}

.form-group select option {
  background: #0a0e1c;
  color: #f1f5f9;
}

/* Dashboard responsive */
@media (max-width: 768px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

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

  .dash-nav {
    padding: 0.75rem 1rem;
  }
}

/* ===== Action Bar ===== */
.action-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn-action {
  padding: 0.6rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-action:hover {
  border-color: rgba(93, 217, 255, 0.4);
  color: #e2e8f0;
}

.btn-action.primary {
  background: linear-gradient(135deg, #5dd9ff, #2ab7ff);
  color: #040712;
  border: none;
  font-weight: 600;
}

.btn-action.primary:hover {
  box-shadow: 0 6px 20px rgba(93, 217, 255, 0.3);
}

/* ===== Members Grid ===== */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.member-card {
  display: block;
  text-decoration: none;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s, transform 0.15s;
}

.member-card:hover {
  border-color: rgba(93, 217, 255, 0.35);
  transform: translateY(-2px);
}

.member-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
}

.member-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.balance-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.balance-amount {
  font-size: 1.25rem;
  font-weight: 700;
}

.member-balance.red .balance-label { color: #f87171; }
.member-balance.red .balance-amount { color: #f87171; }
.member-balance.green .balance-label { color: #4ade80; }
.member-balance.green .balance-amount { color: #4ade80; }
.member-balance.neutral .balance-label { color: #64748b; }
.member-balance.neutral .balance-amount { color: #64748b; }

/* ===== Back Link ===== */
.back-link {
  color: #64748b;
  text-decoration: none;
  font-size: 0.875rem;
  margin-right: 1rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: #5dd9ff;
}

/* ===== Transaction List ===== */
.txn-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.txn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.15s;
}

.txn-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.txn-type {
  font-size: 0.9rem;
  font-weight: 500;
  color: #e2e8f0;
}

.txn-meta {
  font-size: 0.75rem;
  color: #475569;
  margin-top: 0.2rem;
}

.txn-note {
  color: #64748b;
}

.txn-right {
  text-align: right;
}

.txn-amount {
  font-size: 1rem;
  font-weight: 600;
}

.txn-amount.red { color: #f87171; }
.txn-amount.green { color: #4ade80; }

.txn-balance {
  font-size: 0.7rem;
  color: #475569;
  margin-top: 0.15rem;
}

/* ===== Member Card Delete ===== */
.member-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.delete-form {
  margin: 0;
  padding: 0;
  line-height: 1;
}

.btn-delete {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.4rem;
  color: #475569;
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  padding: 0;
  line-height: 1;
}

.btn-delete:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1);
}

/* ===== Transaction Actions ===== */
.txn-right-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.txn-actions {
  display: flex;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.txn-row:hover .txn-actions {
  opacity: 1;
}

.btn-txn-edit,
.btn-txn-del {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.35rem;
  cursor: pointer;
  font-size: 0.8rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}

.btn-txn-edit:hover {
  background: rgba(93, 217, 255, 0.1);
  border-color: rgba(93, 217, 255, 0.3);
}

.btn-txn-del:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
}

.inline-form {
  display: inline;
  margin: 0;
  padding: 0;
}

/* ===== Confirm Modal ===== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 7, 18, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.confirm-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.confirm-box {
  width: 100%;
  max-width: 380px;
  border-radius: 1.25rem;
  border: 1px solid rgba(248, 113, 113, 0.2);
  background: rgba(10, 14, 28, 0.97);
  backdrop-filter: blur(20px);
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(4, 7, 18, 0.8), 0 0 30px rgba(248, 113, 113, 0.06);
  text-align: center;
  transform: scale(0.95) translateY(8px);
  transition: transform 0.2s ease;
}

.confirm-overlay.active .confirm-box {
  transform: scale(1) translateY(0);
}

.confirm-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.confirm-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
}

.confirm-msg {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.confirm-btn {
  padding: 0.6rem 1.5rem;
  border-radius: 0.65rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.confirm-btn:active {
  transform: scale(0.97);
}

.confirm-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

.confirm-btn-cancel:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #e2e8f0;
}

.confirm-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.confirm-btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

/* ===== Themed Type Dots ===== */
.type-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.dot-red {
  background: #f87171;
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.4);
}

.dot-green {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
}

/* ===== Themed Icon Buttons ===== */
.btn-txn-edit,
.btn-txn-del {
  color: #475569;
}

.btn-txn-edit svg,
.btn-txn-del svg {
  display: block;
}

.btn-txn-edit:hover {
  color: #5dd9ff;
}

.btn-txn-del:hover {
  color: #f87171;
}

/* ===== Confirm Icon ===== */
.confirm-icon {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.confirm-icon svg {
  filter: drop-shadow(0 0 8px rgba(248, 113, 113, 0.3));
}

/* ===== Empty State Icon ===== */
.empty-icon {
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: center;
}

.empty-icon svg {
  opacity: 0.5;
}

/* ===== Dash User ===== */
.dash-user {
  color: #5dd9ff;
  font-size: 0.875rem;
  font-weight: 500;
}
