/* CSS Reset & Variables */
:root {
  --bg-primary: #070a13;
  --bg-secondary: #0f1626;
  --bg-card: rgba(20, 30, 54, 0.6);
  --bg-card-border: rgba(255, 255, 255, 0.07);
  
  --color-primary: #c8102e; /* BDV Crimson Red */
  --color-primary-glow: rgba(200, 16, 46, 0.35);
  --color-gold: #f2a900; /* LotiPro Gold */
  --color-gold-glow: rgba(242, 169, 0, 0.3);
  --color-success: #10b981;
  --color-success-glow: rgba(16, 185, 129, 0.2);
  --color-info: #3b82f6;
  --color-text-main: #f8fafc;
  --color-text-muted: #94a3b8;
  
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Socio Colors */
  --color-javier: #ef4444;      /* Red */
  --color-marhelys: #3b82f6;    /* Blue */
  --color-ysaura: #f59e0b;      /* Amber */
  --color-mariagabriela: #10b981; /* Emerald */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--color-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: 80px; /* Offset for bottom nav */
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-card-border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* App Header styling */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  background: rgba(7, 10, 19, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.header-logo {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.logo-red {
  color: var(--color-primary);
  text-shadow: 0 0 10px var(--color-primary-glow);
}

.logo-divider {
  color: var(--color-text-muted);
  font-weight: 300;
}

.logo-gold {
  color: var(--color-gold);
  text-shadow: 0 0 10px var(--color-gold-glow);
}

.header-rates-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

#header-bcv-val {
  color: var(--color-text-main);
}

#header-idi-val {
  color: var(--color-gold);
}

.bubble-divider {
  color: var(--bg-card-border);
}

/* Welcome layout Header sync button */
.welcome-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-sync {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  color: var(--color-text-main);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-sync:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-primary);
}

/* Notification Banner */
.notification-banner {
  background: var(--bg-card);
  border: 1px solid var(--color-primary);
  border-left: 5px solid var(--color-primary);
  padding: 12px 16px;
  margin: 15px 15px 0 15px;
  border-radius: var(--border-radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  animation: slideInDown 0.3s ease;
}

.notification-banner.hidden {
  display: none;
}

.notification-banner button {
  background: transparent;
  border: none;
  color: var(--color-text-main);
  font-size: 1.2rem;
  cursor: pointer;
}

/* App Main Content Container */
.app-main {
  flex: 1;
  padding: 16px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

/* Navigation Views */
.app-view {
  display: none;
  animation: fadeIn 0.4s ease;
}

.app-view.active {
  display: block;
}

/* Cards & Layout Grid */
.welcome-card {
  margin-bottom: 20px;
}

.welcome-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
}

.welcome-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.dashboard-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.card-icon {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.card-info h3 {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  margin-bottom: 2px;
}

.card-value {
  font-size: 1.15rem;
  font-weight: 700;
  display: block;
}

.card-sub-value {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 1px;
  display: block;
}

.text-accent {
  color: var(--color-primary);
}

/* Quick Action card */
.action-card-quick {
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.1) 0%, rgba(242, 169, 0, 0.05) 100%);
  border: 1px solid rgba(200, 16, 46, 0.2);
  border-radius: var(--border-radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

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

.quick-action-text p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.action-card-quick button {
  white-space: nowrap;
}

/* Progress Card */
.progress-card {
  margin-bottom: 16px;
}

.progress-card h3, .chart-card h3, .table-card h3, .settings-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.progress-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-gold));
  box-shadow: 0 0 8px var(--color-primary-glow);
  border-radius: 4px;
  width: 0;
  transition: width 0.8s ease-in-out;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

/* Chart Container & SVG */
.chart-card {
  margin-bottom: 16px;
}

.chart-container {
  height: 170px;
  width: 100%;
  margin-bottom: 10px;
  position: relative;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.color-dot.color-adv {
  background: var(--color-primary);
}

.color-dot.color-members {
  background: var(--color-gold);
}

/* Chart SVG elements */
.chart-axis-line {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart-line-adv {
  stroke: var(--color-primary);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-members {
  stroke: var(--color-gold);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area-adv {
  fill: url(#grad-adv);
  opacity: 0.15;
}

.chart-area-members {
  fill: url(#grad-members);
  opacity: 0.15;
}

.chart-node {
  r: 4px;
  cursor: pointer;
  transition: r 0.1s ease;
}

.chart-node:hover {
  r: 6px;
}

.chart-text {
  fill: var(--color-text-muted);
  font-size: 9px;
  font-weight: 400;
}

/* Bottom Navigation Bar */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: rgba(15, 22, 38, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--bg-card-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  max-width: 600px;
  margin: 0 auto;
  border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}

.nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  flex: 1;
  height: 100%;
  cursor: pointer;
  gap: 3px;
  transition: var(--transition-smooth);
}

.nav-icon {
  font-size: 1.15rem;
  opacity: 0.7;
  transition: var(--transition-smooth);
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 500;
}

.nav-item.active {
  color: var(--color-primary);
}

.nav-item.active .nav-icon {
  opacity: 1;
  transform: translateY(-2px);
  filter: drop-shadow(0 0 5px var(--color-primary-glow));
}

/* Credito View Header & Badges */
.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title-bar h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.badge {
  background: rgba(200, 16, 46, 0.15);
  border: 1px solid rgba(200, 16, 46, 0.3);
  color: #ff6b81;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.info-credit-card {
  border-left: 4px solid var(--color-primary);
  margin-bottom: 16px;
}

.loan-stats-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loan-stats-header label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  display: block;
}

.loan-stats-header strong {
  font-size: 1.45rem;
  font-weight: 800;
  display: block;
  margin: 1px 0;
}

.loan-stats-header span {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: block;
}

.cost-breakdown {
  font-size: 0.75rem !important;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.net-received {
  font-size: 0.9rem !important;
  color: var(--color-success);
  margin-top: 6px;
}

/* Adjuster card */
.adjuster-card {
  margin-bottom: 16px;
}

.adjuster-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.idi-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Custom range slider styling */
.custom-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-text-main);
  box-shadow: 0 0 8px var(--color-primary-glow);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.custom-slider::-webkit-slider-thumb:active {
  transform: scale(1.15);
}

.idi-value-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-sm);
  padding: 6px 10px;
}

.input-prefix {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-right: 6px;
  font-weight: 500;
}

.input-suffix {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-left: 6px;
}

.idi-value-container input {
  background: transparent;
  border: none;
  color: var(--color-text-main);
  font-size: 1rem;
  font-weight: 700;
  width: 100%;
  outline: none;
}

/* Buttons */
.action-bar {
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  width: 100%;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-main);
  box-shadow: 0 4px 12px var(--color-primary-glow);
}

.btn-primary:hover {
  filter: brightness(1.15);
  box-shadow: 0 6px 16px var(--color-primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-main);
  border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.75rem;
  border-radius: 8px;
  width: auto;
}

/* Tables styling */
.table-card {
  margin-bottom: 16px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--bg-card-border);
  margin-top: 6px;
}

.amortization-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.75rem;
  white-space: nowrap;
}

.amortization-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text-muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-card-border);
}

.amortization-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-card-border);
  color: var(--color-text-main);
}

.amortization-table tr:last-child td {
  border-bottom: none;
}

.amortization-table tr.paid-row {
  opacity: 0.6;
  background: rgba(16, 185, 129, 0.02);
}

.status-indicator {
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  display: inline-block;
}

.status-indicator.pending {
  background: rgba(242, 169, 0, 0.1);
  color: var(--color-gold);
  border: 1px solid rgba(242, 169, 0, 0.2);
}

.status-indicator.paid {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Socios View Cards & Balances */
.socios-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.socio-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-md);
  padding: 14px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

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

.socio-name-role h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.socio-days {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.socio-color-pill {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* Individual colors classes */
.socio-javier { background-color: var(--color-javier); box-shadow: 0 0 8px var(--color-javier); }
.socio-marhelys { background-color: var(--color-marhelys); box-shadow: 0 0 8px var(--color-marhelys); }
.socio-ysaura { background-color: var(--color-ysaura); box-shadow: 0 0 8px var(--color-ysaura); }
.socio-mariagabriela { background-color: var(--color-mariagabriela); box-shadow: 0 0 8px var(--color-mariagabriela); }

.socio-card-balance {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.socio-bal-box {
  flex: 1;
}

.socio-bal-box label {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  display: block;
}

.socio-bal-box span {
  font-weight: 700;
  font-size: 0.85rem;
}

.socio-bal-box.balance-amount {
  text-align: right;
}

.text-red { color: #ef4444; }
.text-green { color: #10b981; }

.socio-progress-container {
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.socio-progress-bar {
  height: 100%;
  border-radius: 3px;
}

/* Publicidad View Breakdown Styles */
.ad-metrics-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.metric-box {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-sm);
  padding: 10px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.metric-label {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}

.metric-val {
  font-size: 0.85rem;
  font-weight: 700;
  display: block;
}

.metric-sub {
  font-size: 0.6rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 1px;
}

.text-gold {
  color: var(--color-gold);
}

.text-green {
  color: var(--color-success);
}

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

.custom-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  color: var(--color-text-main);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.7rem;
  outline: none;
  cursor: pointer;
}

.expense-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-state {
  text-align: center;
  padding: 30px 16px;
}

.empty-state p {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.expense-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.expense-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.expense-details h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.expense-platform-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  margin-right: 4px;
  text-transform: uppercase;
}

.platform-facebook { background: rgba(59, 89, 152, 0.15); color: #8b9dc3; border: 1px solid rgba(59, 89, 152, 0.3); }
.platform-instagram { background: rgba(225, 48, 108, 0.15); color: #f783ac; border: 1px solid rgba(225, 48, 108, 0.3); }
.platform-google { background: rgba(219, 68, 85, 0.15); color: #ff8787; border: 1px solid rgba(219, 68, 85, 0.3); }
.platform-tiktok { background: rgba(0, 242, 234, 0.15); color: #63e6be; border: 1px solid rgba(0, 242, 234, 0.3); }
.platform-otros { background: rgba(120, 120, 120, 0.15); color: #aaaaaa; border: 1px solid rgba(120, 120, 120, 0.3); }

.expense-desc {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 3px;
}

.expense-meta {
  text-align: right;
}

.expense-val-bs {
  font-size: 0.85rem;
  font-weight: 700;
  display: block;
}

.expense-val-usd {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  display: block;
}

.expense-acquired {
  font-size: 0.65rem;
  color: var(--color-success);
  margin-top: 1px;
  display: block;
}

.expense-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  justify-content: flex-end;
}

.btn-action-icon {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 3px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.btn-action-icon:hover {
  color: var(--color-text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-action-icon.delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Settings View Styles */
.settings-card {
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-sm);
  padding: 6px 10px;
  width: 100%;
}

.input-wrapper input {
  background: transparent;
  border: none;
  color: var(--color-text-main);
  font-size: 0.9rem;
  width: 100%;
  outline: none;
}

.form-help {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* File Upload customization */
.file-upload-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
}

.file-upload-wrapper input[type=file] {
  font-size: 100px;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.info-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
  margin-top: 6px;
}

.info-details-table th {
  color: var(--color-text-muted);
  text-align: left;
  font-weight: 500;
  padding: 6px 8px;
  border-bottom: 1px solid var(--bg-card-border);
}

.info-details-table td {
  text-align: right;
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--bg-card-border);
}

/* MODALS STYLING */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-lg);
  max-width: 440px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.hidden .modal-container {
  transform: scale(0.92);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-card-border);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

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

.modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-body select, .modal-body input, .modal-body textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-main);
  padding: 8px 12px;
  font-size: 0.85rem;
  width: 100%;
  outline: none;
}

.modal-body select:focus, .modal-body input:focus, .modal-body textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 6px var(--color-primary-glow);
}

.modal-body textarea {
  height: 60px;
  resize: none;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.modal-footer .btn {
  width: auto;
}

/* Custom modal sub-elements */
.modal-rates-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.modal-rate-indicator {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.indicator-lbl {
  font-size: 0.65rem;
  color: var(--color-text-muted);
}

.modal-rate-indicator input {
  font-size: 0.8rem !important;
  font-weight: 700;
  padding: 6px 10px !important;
}

.modal-divider {
  border: 0;
  height: 1px;
  background: var(--bg-card-border);
  margin: 6px 0;
}

.form-group-checkbox {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkbox-wrapper input[type=checkbox] {
  width: 16px !important;
  height: 16px !important;
  cursor: pointer;
  margin: 0;
}

.checkbox-wrapper label {
  font-size: 0.7rem !important;
  color: var(--color-gold) !important;
  cursor: pointer;
  font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes modalScaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* USDT / Binance Module Styles */
.usdt-live-card {
  border: 1px solid rgba(240, 185, 11, 0.25);
  background: linear-gradient(135deg, rgba(240, 185, 11, 0.05) 0%, rgba(20, 30, 54, 0.6) 100%);
  margin-bottom: 14px;
}

.usdt-live-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.usdt-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 2px;
}

.usdt-rate {
  font-size: 1.8rem;
  font-weight: 800;
  color: #f0b90b;
  text-shadow: 0 0 12px rgba(240, 185, 11, 0.4);
  display: block;
}

.usdt-rate-sub {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 2px;
}

.usdt-rate-comparison {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.rate-comp-box {
  text-align: center;
}

.rate-comp-box label {
  font-size: 0.6rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}

.rate-comp-box span {
  font-size: 0.8rem;
  font-weight: 600;
}

/* Arbitrage alert box */
.usdt-alert-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--border-radius-md);
  margin-bottom: 14px;
  animation: slideInDown 0.3s ease;
}

.usdt-alert-box.hidden {
  display: none;
}

.usdt-alert-box.alert-profit {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 4px solid var(--color-success);
}

.usdt-alert-box.alert-loss {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-left: 4px solid #ef4444;
}

.usdt-alert-box.alert-hold {
  background: rgba(242, 169, 0, 0.08);
  border: 1px solid rgba(242, 169, 0, 0.25);
  border-left: 4px solid var(--color-gold);
}

.usdt-alert-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.usdt-alert-box strong {
  font-size: 0.85rem;
  display: block;
  margin-bottom: 2px;
}

.usdt-alert-box p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* USDT Portfolio grid */
.usdt-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.usdt-metric {
  border: 1px solid rgba(240, 185, 11, 0.1);
}

/* USDT lot items */
.usdt-lot-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: var(--transition-smooth);
  margin-bottom: 8px;
}

.usdt-lot-item:hover {
  border-color: rgba(240, 185, 11, 0.2);
}

.usdt-lot-item.lot-buy {
  border-left: 3px solid var(--color-success);
}

.usdt-lot-item.lot-sell {
  border-left: 3px solid #ef4444;
}

.lot-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.lot-type-badge.buy {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.lot-type-badge.sell {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.lot-pnl-indicator {
  font-size: 0.65rem;
  margin-top: 2px;
  display: block;
}

.lot-pnl-indicator.positive { color: var(--color-success); }
.lot-pnl-indicator.negative { color: #ef4444; }
.lot-pnl-indicator.neutral { color: var(--color-text-muted); }

/* Media Queries */
@media (max-width: 440px) {
  .usdt-portfolio-grid {
    grid-template-columns: 1fr;
  }
  .usdt-rate-comparison {
    grid-template-columns: 1fr;
  }
}
