:root {
  --primary: #1e5e45;
  --primary-hover: #154533;
  --primary-container: #d2ebe0;
  --on-primary: #ffffff;
  --bg-page: #f8faf9;
  --surface: #ffffff;
  --surface-border: #e3eae6;
  --text-main: #141b18;
  --text-muted: #5e6b65;
  --accent-gold: #c8892d;
  --danger: #ba1a1a;
  --danger-container: #ffdad6;
  --success: #2e7d32;
  --success-container: #e8f5e9;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(30, 94, 69, 0.25);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.brand-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--primary-container);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 6px;
}

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

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
}

.status-pill.status-synced {
  background: var(--success-container);
  color: var(--success);
  border-color: #bbf7d0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-page);
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  border: 1px solid var(--surface-border);
  font-size: 0.8rem;
  font-weight: 600;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.user-name {
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main */
.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Security Banner */
.security-banner {
  background: linear-gradient(135deg, #e3f3eb 0%, #ebf7f0 100%);
  border: 1px solid #c2e5d4;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.security-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.security-text {
  flex: 1;
}

.security-text strong {
  color: var(--primary);
  font-size: 0.95rem;
  display: block;
  margin-bottom: 2px;
}

.security-text p {
  color: #3b574a;
  font-size: 0.82rem;
}

.security-meta {
  display: flex;
  gap: 6px;
}

.crypto-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  background: #fff;
  color: var(--primary);
  border: 1px solid #b2dac7;
  padding: 3px 8px;
  border-radius: 6px;
}

/* User Metrics Grid */
.user-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.user-metric-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.user-metric-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.user-metric-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.user-metric-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.text-success { color: var(--success) !important; }
.text-primary { color: var(--primary) !important; }
.text-emerald { color: #059669 !important; }

/* Action Bar */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 94, 69, 0.1);
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Items Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

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

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

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  word-break: break-word;
}

.card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-due {
  background: #fde8e8;
  color: #c81e1e;
  border: 1px solid #fca5a5;
}

.badge-paid {
  background: var(--success-container);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.badge-note {
  background: var(--primary-container);
  color: var(--primary);
  border: 1px solid #a7f3d0;
}

.card-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.card-body {
  font-size: 0.86rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 14px;
  white-space: pre-wrap;
  line-height: 1.45;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--surface-border);
  padding-top: 10px;
}

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

.card-action-btn {
  background: transparent;
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.card-action-btn:hover {
  background: var(--bg-page);
  color: var(--text-main);
  border-color: #cbd5e1;
}

.card-action-btn.btn-pay {
  color: var(--success);
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.card-action-btn.btn-pay:hover {
  background: #dcfce7;
}

.card-action-btn.btn-delete:hover {
  color: var(--danger);
  border-color: #fca5a5;
  background: #fef2f2;
}

.badge-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  background: var(--bg-page);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(30, 94, 69, 0.2);
}

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

.btn-outline {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-page);
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  backdrop-filter: blur(5px);
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--surface-border);
  max-height: 92vh;
  overflow-y: auto;
}

.modal-brand {
  text-align: center;
  margin-bottom: 20px;
}

.modal-brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 4px 10px rgba(30, 94, 69, 0.25);
}

.modal-brand h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--surface-border);
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.btn-close:hover {
  color: var(--text-main);
}

.modal-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  background: var(--bg-page);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  margin-bottom: 20px;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.input-icon-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.form-control.with-icon {
  padding-left: 38px;
}

.auth-alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 14px;
  line-height: 1.4;
}

.auth-alert.error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.auth-alert.success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
}

.modal-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-top: 18px;
  line-height: 1.45;
}

/* Forms */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 94, 69, 0.1);
}

.form-row {
  display: flex;
  gap: 12px;
}

.col-6 {
  flex: 1;
}

.type-selector {
  display: flex;
  gap: 8px;
}

.type-pill {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--surface-border);
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.type-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.modal-footer-btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--surface-border);
}

/* Footer */
.app-footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--surface-border);
  padding: 18px 20px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  color: var(--primary);
}

.footer-sep {
  color: var(--surface-border);
}

.footer-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  background: var(--bg-page);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--surface-border);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInToast 0.25s ease forwards;
}

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

.hidden {
  display: none !important;
}

.col-4 {
  flex: 1;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #991b1b;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-text-action:hover {
  background: var(--primary-container);
}

.with-icon-right {
  padding-right: 40px !important;
}

.input-icon-btn-right {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.input-icon-btn-right:hover {
  color: var(--text-main);
}

/* Credential Item Card */
.credential-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-page);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  margin-top: 8px;
  gap: 8px;
}

.credential-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 70px;
  flex-shrink: 0;
}

.credential-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.btn-copy-small {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-copy-small:hover {
  background: var(--primary-container);
  color: var(--primary);
  border-color: var(--primary);
}

@media (max-width: 640px) {
  .btn-text-responsive {
    display: none;
  }
  .header-actions {
    gap: 6px;
  }
  .user-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
  .security-meta {
    display: none;
  }
}

/* Quick Smart Command Box */
.quick-command-box {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.quick-command-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, #2563eb 50%, var(--accent-gold) 100%);
}

.quick-command-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.quick-command-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-container);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-command-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.quick-command-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}

.quick-command-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.quick-command-input {
  flex: 1;
  font-size: 0.88rem;
  padding: 10px 14px;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.quick-chip {
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.quick-chip:hover {
  background: var(--primary-container);
  color: var(--primary);
  border-color: var(--primary);
}

/* Main Navigation Tabs Bar */
.main-tabs-bar {
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-tabs-bar::-webkit-scrollbar {
  display: none;
}

.main-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.main-tab:hover {
  color: var(--text-main);
  background: var(--bg-page);
}

.main-tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(30, 94, 69, 0.25);
}

.tab-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.main-tab.active .tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Color Palette Swatches for Notes */
.color-picker-group {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.color-swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.color-swatch-btn.selected {
  transform: scale(1.15);
  border-color: var(--text-main);
  box-shadow: 0 0 0 2px var(--surface);
}

/* Installment Progress */
.installment-box {
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 8px;
  font-size: 0.75rem;
}

.installment-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--surface-border);
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}

.installment-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
}

/* Circle Cards */
.circle-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.circle-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.circle-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.circle-emoji-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.circle-members-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
}

.member-role-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--primary-container);
  color: var(--primary);
}

/* Payment History Table & Rows */
.payment-history-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.data-table th {
  background: var(--bg-page);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--surface-border);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface-border);
  color: var(--text-main);
}

.data-table tr:hover td {
  background: #fbfdfc;
}

/* Password Generator Box in Credential Modal */
.generator-box {
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 8px;
}

.generator-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.generator-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.75rem;
  align-items: center;
}

/* Analytics Layout */
.analytics-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.analytics-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.analytics-card h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.8rem;
}

.breakdown-bar-bg {
  height: 8px;
  background: var(--bg-page);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.breakdown-bar-val {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
}

@media (max-width: 768px) {
  .analytics-layout {
    grid-template-columns: 1fr;
  }
}

/* Voice & Smart Calculator System */
.calc-panel-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .calc-panel-grid {
    grid-template-columns: 1fr;
  }
}

.calc-card, .calc-journal-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.calc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.calc-header-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

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

.calc-currency-select {
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.btn-calc-voice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-calc-voice:hover, .btn-calc-voice.listening {
  background: #16a34a;
  color: #ffffff;
}

.calc-screen {
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 16px;
  text-align: right;
  margin-bottom: 14px;
}

.calc-voice-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
  text-align: left;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  animation: pulse 1s infinite;
}

.calc-expression {
  font-size: 1.1rem;
  color: var(--text-muted);
  min-height: 24px;
  word-break: break-all;
  font-family: monospace;
}

.calc-result-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  margin: 6px 0;
}

.calc-currency-sym {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.calc-result-val {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.1;
  font-family: monospace;
}

.calc-metadata-pill {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.calc-presets-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.calc-preset-chip {
  padding: 4px 10px;
  border-radius: 16px;
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s;
}

.calc-preset-chip:hover {
  background: var(--surface-border);
}

.calc-preset-chip.primary {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.3);
}

.calc-preset-chip.accent {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  border-color: rgba(99, 102, 241, 0.3);
}

.calc-keypad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.btn-calc-key {
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-calc-key:active {
  transform: scale(0.96);
}

.btn-calc-key.op {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.2);
  font-weight: 800;
}

.btn-calc-key.special {
  background: var(--bg-page);
  color: var(--text-muted);
}

.btn-calc-key.equals {
  background: #16a34a;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

/* Journal List & Tape */
.calc-journal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calc-journal-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.calc-journal-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.calc-journal-search {
  margin-bottom: 12px;
}

.calc-journal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.calc-journal-item {
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.15s;
}

.calc-journal-item:hover {
  border-color: #16a34a;
}

.calc-journal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.calc-journal-record-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.calc-journal-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.calc-journal-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.calc-journal-math-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0;
}

.calc-journal-expr {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.calc-journal-val {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.calc-journal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--surface-border);
}

/* ================= SNIPPETS HUB STYLES ================= */
.pinned-spotlight-bar {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 20px;
}

.pinned-spotlight-header {
  margin-bottom: 10px;
}

.pinned-spotlight-badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--primary);
  text-transform: uppercase;
}

.pinned-snippet-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pinned-snippet-card {
  min-width: 220px;
  max-width: 260px;
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pinned-snippet-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.pinned-snippet-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pinned-snippet-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.pinned-snippet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
}

.pinned-tag-pill {
  background: var(--surface-border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-main);
  font-weight: 600;
}

.pinned-copy-hint {
  color: var(--primary);
  font-weight: 700;
}

/* Snippet Cards */
.snippet-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s;
  position: relative;
}

.snippet-card.pinned {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.06);
}

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

.snippet-card-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.snippet-pin-icon {
  color: var(--primary);
  font-size: 0.85rem;
}

.snippet-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snippet-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.snippet-tag-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--surface-container-high);
  color: var(--primary);
}

.snippet-usage-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  padding: 2px 6px;
  border-radius: 10px;
}

.snippet-content-box {
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-main);
  margin-bottom: 12px;
  cursor: pointer;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.snippet-content-box.align-center {
  text-align: center;
}

.snippet-content-box.align-right {
  text-align: right;
}

.snippet-content-box.align-left {
  text-align: left;
}

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

.btn-snippet-copy {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-snippet-copy:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-snippet-copy:active {
  transform: translateY(1px);
}

.btn-share-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--surface-border);
  background: var(--surface-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.btn-share-icon:hover {
  transform: translateY(-1px);
}

.btn-share-wa {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.btn-share-sms {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.3);
}

.btn-share-email {
  color: #9333ea;
  background: rgba(147, 51, 234, 0.1);
  border-color: rgba(147, 51, 234, 0.3);
}

/* Snippet Editor Toolbar */
.snippet-editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--surface-container-high);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  margin-top: 6px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--surface-border);
  margin: 0 4px;
}

.btn-tool {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-tool:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-tool.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-tool-accent {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.25);
}

.snippet-textarea {
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

.snippet-preview-box {
  background: var(--bg-page);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 180px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Redesigned Authentication Experience */
.auth-modal-v2 {
  max-width: 520px;
  width: 100%;
  padding: 30px 28px;
}

.auth-tabs-v2 {
  display: flex;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}

.auth-tab-btn-v2 {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.85rem;
  color: #64748b;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn-v2.active {
  background: #ffffff;
  color: #1e5e45;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.btn-google-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-google-auth:hover {
  background: #f8fafc;
  border-color: #1e5e45;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
  padding: 0 12px;
}

.otp-flex-row {
  display: flex;
  gap: 8px;
}

.otp-flex-row input {
  flex: 1;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.offline-toggle-card {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.offline-toggle-card:hover {
  border-color: #1e5e45;
  background: #f0fdf4;
}

.offline-toggle-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.offline-toggle-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 3px;
}

.auth-copyright {
  text-align: center;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}


