/* ── Telescope Finance — Design System ─────────────────────────────────────── */
:root {
  --navy-deep:  #151848;
  --navy-dark:  #1E2266;
  --navy:       #2D3191;
  --sky:        #5BC4D8;
  --sky-light:  rgba(91,196,216,0.15);
  --sky-border: rgba(91,196,216,0.25);
  --white:      #FFFFFF;
  --white-80:   rgba(255,255,255,0.80);
  --white-60:   rgba(255,255,255,0.60);
  --white-30:   rgba(255,255,255,0.30);
  --white-08:   rgba(255,255,255,0.08);
  --green:      #2ECC71;
  --red:        #E74C3C;
  --amber:      #F39C12;
  --surface:    rgba(255,255,255,0.05);
  --surface-hover: rgba(255,255,255,0.09);
  --border:     rgba(91,196,216,0.18);
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
}

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

html { font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy-deep);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
}

/* ── Background shared ── */
.tf-bg {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(135deg, #151848 0%, #1E2266 45%, #2D3191 100%);
}
.tf-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(91,196,216,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91,196,216,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
}

/* ── Typography ── */
h1,h2,h3 { font-family: 'DM Serif Display', serif; font-weight: 400; line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
.label {
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--sky); opacity: 0.85;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem; font-weight: 500;
  cursor: pointer; border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--sky); color: var(--navy-deep);
}
.btn-primary:hover { background: #4DB8CC; transform: translateY(-1px); }

.btn-ghost {
  background: var(--white-08); color: var(--white-80);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--white); }

.btn-danger {
  background: rgba(231,76,60,0.15); color: #E74C3C;
  border: 1px solid rgba(231,76,60,0.3);
}
.btn-danger:hover { background: rgba(231,76,60,0.25); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Form elements ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 0.8rem; font-weight: 500;
  color: var(--white-60); letter-spacing: 0.03em;
}
.field input, .field select, .field textarea {
  background: var(--white-08);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  padding: 0.6rem 0.85rem;
  width: 100%;
  transition: border-color 0.2s ease, background 0.2s ease;
  appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--sky);
  background: rgba(91,196,216,0.07);
}
.field input::placeholder { color: var(--white-30); }
.field select option { background: var(--navy-dark); color: var(--white); }

/* ── Card / Panel ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

/* ── Table ── */
.tf-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tf-table thead th {
  text-align: left; padding: 0.75rem 1rem;
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--sky); opacity: 0.8;
  border-bottom: 1px solid var(--border);
}
.tf-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s ease;
}
.tf-table tbody tr:hover { background: var(--white-08); }
.tf-table tbody td { padding: 0.7rem 1rem; color: var(--white-80); }
.tf-table tbody td.monto { font-variant-numeric: tabular-nums; font-weight: 500; }
.tf-table tbody td.monto.ing  { color: var(--green); }
.tf-table tbody td.monto.gas  { color: var(--red); }
.tf-table tbody td.monto.tra  { color: var(--sky); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.04em;
}
.badge-ing  { background: rgba(46,204,113,0.12); color: var(--green); border: 1px solid rgba(46,204,113,0.25); }
.badge-gas  { background: rgba(231,76,60,0.12);  color: var(--red);   border: 1px solid rgba(231,76,60,0.25);  }
.badge-tra  { background: var(--sky-light);      color: var(--sky);   border: 1px solid var(--sky-border);     }

/* ── Alert messages ── */
.alert {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.88rem; margin-bottom: 1rem;
}
.alert-error   { background: rgba(231,76,60,0.15);  color: #F1948A; border: 1px solid rgba(231,76,60,0.3);  }
.alert-success { background: rgba(46,204,113,0.12); color: #82E0AA; border: 1px solid rgba(46,204,113,0.25);}

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(21,24,72,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--white);
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
}
.navbar-brand .dot { color: var(--sky); }
.navbar-right { display: flex; align-items: center; gap: 0.75rem; }
.navbar-user {
  font-size: 0.82rem; color: var(--white-60);
}

/* ── Stat cards ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
}
.stat-card .stat-label {
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--white-60); margin-bottom: 6px;
}
.stat-card .stat-value {
  font-size: 1.5rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--white);
}
.stat-card .stat-value.pos { color: var(--green); }
.stat-card .stat-value.neg { color: var(--red); }

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,18,50,0.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.modal {
  background: #1E2266;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%; max-width: 480px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-header h3 { font-family: 'DM Serif Display', serif; font-size: 1.25rem; }
.modal-close {
  background: none; border: none; color: var(--white-60);
  font-size: 1.25rem; cursor: pointer; padding: 4px;
  transition: color 0.2s; line-height: 1;
}
.modal-close:hover { color: var(--white); }
.modal-footer {
  display: flex; gap: 0.75rem; justify-content: flex-end;
  margin-top: 1.5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}
.fade-up { animation: fadeUp 0.6s cubic-bezier(0.22,1,0.36,1) both; }
.fade-up-2 { animation: fadeUp 0.6s cubic-bezier(0.22,1,0.36,1) 0.1s both; }
.fade-up-3 { animation: fadeUp 0.6s cubic-bezier(0.22,1,0.36,1) 0.2s both; }

/* ── Utilities ── */
.text-sky    { color: var(--sky); }
.text-muted  { color: var(--white-60); }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
@media(max-width:600px) {
  .grid-2,.grid-3,.grid-4 { grid-template-columns:1fr; }
  .modal { padding:1.5rem 1.25rem; margin:0.5rem; }
  .modal-overlay { padding:0.75rem; align-items:flex-end; }
  .navbar { padding:0 1rem; }
  .tf-table { display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
}
