/* ==========================================================================
   TradeSplit OS — Premium Fintech Stylesheet
   Modern Institutional Dark Design System with Cyan/Emerald/Indigo Accents
   ========================================================================== */

:root {
  --bg-deep: #07090e;
  --bg-surface: #0e131f;
  --bg-card: #141b2d;
  --bg-card-hover: #192238;
  --bg-card-alt: #101626;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-active: rgba(255, 255, 255, 0.16);
  --border-glow: rgba(78, 205, 196, 0.25);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-disabled: #475569;

  /* Accent Colors */
  --accent-cyan: #4ecdc4;
  --accent-cyan-glow: rgba(78, 205, 196, 0.2);
  --accent-emerald: #10b981;
  --accent-emerald-soft: rgba(16, 185, 129, 0.15);
  --accent-indigo: #6366f1;
  --accent-indigo-soft: rgba(99, 102, 241, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-soft: rgba(245, 158, 11, 0.15);
  --accent-rose: #f43f5e;
  --accent-rose-soft: rgba(244, 63, 94, 0.15);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px rgba(78, 205, 196, 0.12);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(at 15% 15%, rgba(99, 102, 241, 0.08) 0px, transparent 45%),
    radial-gradient(at 85% 20%, rgba(78, 205, 196, 0.08) 0px, transparent 40%),
    radial-gradient(at 50% 90%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* App Shell Layout */
.app-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================================================
   Header & FX Bar
   ========================================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 8px;
}

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

.logo-badge {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #10b981 0%, #4ecdc4 50%, #6366f1 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 18px rgba(78, 205, 196, 0.3);
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

.accent-text {
  background: linear-gradient(135deg, #4ecdc4, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* FX Ticker Card */
.fx-ticker-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-subtle);
  min-width: 280px;
  transition: border-color var(--transition-fast);
}

.fx-ticker-card:hover {
  border-color: var(--border-active);
}

.fx-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseAnimation 2s infinite ease-in-out;
}

@keyframes pulseAnimation {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.fx-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.fx-values-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.currency-pair {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.rate-number {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.fx-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 5px;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--border-active);
}

.pill-btn.active {
  background: var(--accent-cyan-glow);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.icon-btn {
  padding: 6px;
  border-radius: var(--radius-sm);
}

.icon-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.fx-manual-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 12px;
}

.fx-manual-input-wrap input {
  width: 90px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 600;
}

.fx-timestamp {
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
}

/* ==========================================================================
   Tab Navigation
   ========================================================================== */
.tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #fff;
  background: var(--bg-card);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-subtle);
}

.badge-counter {
  font-size: 11px;
  background: var(--accent-cyan);
  color: #07090e;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Layout Grids & Cards
   ========================================================================== */
.calc-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.card-title-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-badge {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.split-rule-badge {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.dot-indigo { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-indigo); display: inline-block; }
.dot-emerald { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-cyan); display: inline-block; }
.dot-amber { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-amber); display: inline-block; }

/* Input Styles */
.input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.gross-input-container {
  margin-bottom: 20px;
}

.currency-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 18px;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
}

.currency-code {
  position: absolute;
  right: 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.gross-input {
  width: 100%;
  background: #090d18;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 65px 16px 42px;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  outline: none;
  transition: all var(--transition-fast);
}

.gross-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.15);
}

.threshold-alert {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--accent-amber);
  background: var(--accent-amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: none;
}

.threshold-alert.visible {
  display: flex;
}

/* Quick Range Pills */
.quick-ranges {
  margin-bottom: 22px;
}

.quick-range-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.range-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.range-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.range-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-active);
}

.range-pill.active {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
  font-weight: 700;
}

/* Metadata inputs */
.meta-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}

.input-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-field input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.input-field input:focus {
  border-color: var(--accent-cyan);
}

/* Split Preset Selector */
.split-preset-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 18px;
}

.section-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.preset-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-option:hover {
  border-color: var(--border-active);
}

.preset-option.active {
  border-color: var(--accent-cyan);
  background: rgba(78, 205, 196, 0.05);
}

.preset-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent-cyan);
}

.preset-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.preset-formula {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Custom sliders */
.custom-splits-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-slider-row .slider-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.slider-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
}

.custom-slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent-cyan);
  background: #090d18;
  height: 6px;
  border-radius: 3px;
  outline: none;
}

.slider-sum-check {
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  color: var(--accent-emerald);
}

/* Partner Sub-split toggle */
.trader-subsplit-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.subsplit-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.subsplit-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #242f48;
  transition: .3s;
  border-radius: 34px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--accent-cyan);
}

input:checked + .slider-round:before {
  transform: translateX(20px);
}

/* ==========================================================================
   Results Panel & Participant Cards
   ========================================================================== */
.results-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Visual Progress Bar */
.split-bar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
}

.split-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 12px;
}

.bar-title {
  font-weight: 700;
  color: var(--text-secondary);
}

.bar-total-label strong {
  color: #fff;
  font-family: var(--font-mono);
}

.multi-progress-bar {
  display: flex;
  height: 28px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #090d18;
  border: 1px solid var(--border-subtle);
}

.bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.broker-segment {
  background: linear-gradient(90deg, #4f46e5, #6366f1);
}

.trader-segment {
  background: linear-gradient(90deg, #059669, #10b981);
}

.sub-segment {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

/* Participant Cards Grid */
.participants-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .participants-grid {
    grid-template-columns: 1fr;
  }
}

.participant-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  overflow: hidden;
}

.participant-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
}

.broker-card {
  border-top: 3px solid var(--accent-indigo);
}

.trader-card {
  border-top: 3px solid var(--accent-emerald);
}

.sub-card {
  border-top: 3px solid var(--accent-amber);
}

.participant-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

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

.avatar-ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.broker-ring {
  background: var(--accent-indigo-soft);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.trader-ring {
  background: var(--accent-emerald-soft);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.sub-ring {
  background: var(--accent-amber-soft);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.participant-role {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.participant-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.percentage-pill {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.broker-pill {
  background: var(--accent-indigo-soft);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.trader-pill {
  background: var(--accent-emerald-soft);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sub-pill {
  background: var(--accent-amber-soft);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.payout-amounts {
  margin-bottom: 18px;
}

.amount-primary {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.amt-currency {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-secondary);
}

.amt-val {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.amt-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.amount-secondary {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.amt-php-symbol {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.amt-php-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.amt-php-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

/* 50/50 Partner Breakdown Inside Trader Card */
.partner-split-breakdown {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-partner-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.sub-partner-title {
  color: var(--text-secondary);
  font-weight: 600;
}

.sub-partner-val strong {
  font-family: var(--font-mono);
  color: #fff;
}

.sub-partner-val .sub-php {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 11px;
  margin-left: 4px;
}

.sub-divider {
  height: 1px;
  background: var(--border-subtle);
}

.participant-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
}

.rate-used-tag {
  color: var(--text-muted);
}

.rate-val-tag {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.copy-amt-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-amt-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Action Card / Summary */
.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-card);
}

.action-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.summary-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.summary-usd {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.summary-php {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.summary-rate {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

.action-buttons-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.3);
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--border-active);
}

.btn-danger-outline {
  background: var(--accent-rose-soft);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

.btn-danger-outline:hover {
  background: rgba(244, 63, 94, 0.25);
  color: #fff;
}

/* ==========================================================================
   TAB 2: History & Settlement Ledger
   ========================================================================== */
.history-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-number {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.metric-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.highlight-green { color: var(--accent-emerald); }
.highlight-cyan { color: var(--accent-cyan); }
.highlight-indigo { color: #a5b4fc; }

.history-table-card {
  padding: 0;
  overflow: hidden;
}

.history-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  width: 380px;
  max-width: 100%;
}

.search-wrap svg {
  color: var(--text-muted);
}

.search-wrap input {
  background: none;
  border: none;
  color: #fff;
  font-size: 13px;
  width: 100%;
  outline: none;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

/* Table Responsive */
.table-responsive {
  overflow-x: auto;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.ledger-table th {
  background: var(--bg-surface);
  padding: 14px 18px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.ledger-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.ledger-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.ledger-table .timestamp-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #fff;
}

.ledger-table .ref-cell {
  font-weight: 600;
  color: var(--text-primary);
}

.ledger-table .amount-cell {
  font-family: var(--font-mono);
  font-weight: 700;
}

.amount-usd-strong {
  color: #fff;
}

.amount-php-sub {
  display: block;
  font-size: 11px;
  color: var(--accent-cyan);
}

.table-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 4px;
}

.table-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.table-del-btn {
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.2);
}

.table-del-btn:hover {
  background: var(--accent-rose-soft);
  color: #fff;
}

/* Empty History State */
.empty-ledger {
  padding: 60px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.empty-ledger h3 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.empty-ledger p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 400px;
}

/* ==========================================================================
   MODAL: Printable Voucher
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.voucher-modal-container {
  background: #0f1523;
  border: 1px solid var(--border-active);
  border-radius: var(--radius-xl);
  max-width: 760px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

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

.modal-close-btn:hover {
  color: #fff;
}

.voucher-body {
  position: relative;
  padding: 28px;
  background: #0b0f19;
  border-bottom: 1px solid var(--border-subtle);
  max-height: 75vh;
  overflow-y: auto;
}

.voucher-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.02);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.voucher-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 20px;
}

.doc-brand h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
}

.doc-brand p {
  font-size: 12px;
  color: var(--text-muted);
}

.doc-serial {
  text-align: right;
}

.serial-no {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.serial-date {
  font-size: 11px;
  color: var(--text-muted);
}

.voucher-meta-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 22px;
  font-size: 12px;
}

.vmeta-label {
  color: var(--text-muted);
  margin-right: 6px;
}

.vmeta-val {
  color: #fff;
  font-weight: 600;
}

.status-verified {
  color: var(--accent-emerald);
}

/* Voucher Table */
.voucher-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 28px;
}

.voucher-table th {
  background: var(--bg-surface);
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.voucher-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.voucher-sub-row td {
  background: rgba(0, 0, 0, 0.2);
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 6px;
  padding-bottom: 6px;
}

.voucher-total-row th {
  background: rgba(16, 185, 129, 0.08);
  border-top: 2px solid var(--accent-emerald);
  color: #fff;
  font-size: 12px;
}

.voucher-total-row td {
  background: rgba(16, 185, 129, 0.08);
  border-top: 2px solid var(--accent-emerald);
  font-size: 16px;
}

.highlight-gold {
  color: var(--accent-cyan);
}

.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; color: #fff; }

.voucher-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 36px;
  padding-top: 20px;
}

.sig-block {
  text-align: center;
}

.sig-line {
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  margin-bottom: 8px;
}

.sig-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.sig-role {
  font-size: 11px;
  color: var(--text-muted);
}

.modal-footer {
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-card);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInToast 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast.toast-info {
  border-left: 4px solid var(--accent-cyan);
}

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

/* Footer */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

.footer-sep {
  margin: 0 6px;
  opacity: 0.4;
}

/* Utilities */
.hidden { display: none !important; }

/* Print Media Query */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .app-header, .tab-nav, .calc-grid, .history-metrics-grid, .history-table-card, .app-footer, .modal-header, .modal-footer {
    display: none !important;
  }

  .modal-backdrop {
    position: static !important;
    background: none !important;
    padding: 0 !important;
  }

  .voucher-modal-container {
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
  }

  .voucher-body {
    background: #fff !important;
    color: #000 !important;
    border: none !important;
    max-height: none !important;
    padding: 0 !important;
  }

  .doc-brand h2, .serial-no, .vmeta-val, .sig-name, .font-bold {
    color: #000 !important;
  }

  .voucher-watermark {
    color: rgba(0, 0, 0, 0.05) !important;
  }

  .voucher-table th, .voucher-table td, .voucher-meta-box {
    background: #fff !important;
    color: #000 !important;
    border-color: #ccc !important;
  }

  .sig-line {
    background: #000 !important;
  }
}
