﻿
:root {
  --apple-bg: #f5f5f7;
  --glass-white: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 0, 0, 0.3);
  --primary-red: #ff3b30; /* Rojo Apple iOS */
  --text-black: #1d1d1f;
  --text-gray: #86868b;
  --r: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--apple-bg);
  background-image: radial-gradient(at 0% 0%, rgba(255, 59, 48, 0.05) 0px, transparent 50%),
                    radial-gradient(at 100% 100%, rgba(255, 59, 48, 0.05) 0px, transparent 50%);
  color: var(--text-black);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

/* LOGIN */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  background: var(--glass-white);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px;
  width: 380px;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-box h1 {
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  color: var(--text-black);
}

.login-box p {
  color: var(--text-gray);
  font-size: 15px;
  margin-bottom: 30px;
}

/* APP LAYOUT */
#app-screen { display: none; }

.topbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 18px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.topbar h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-black);
}

.nav {
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  background: #fff;
  overflow-x: auto;
  scrollbar-width: none;
}

.nb {
  background: #f2f2f7;
  border: 1px solid transparent;
  color: var(--text-black);
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nb.active {
  background: var(--primary-red);
  color: #fff;
}

.nb:hover:not(.active) {
  background: #e5e5ea;
}

/* TABS (pestañas dentro de una sección) */
.tab-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab {
  background: #f2f2f7;
  border: 1px solid transparent;
  color: var(--text-black);
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.tab.active {
  background: var(--primary-red);
  color: #fff;
}

.tab:hover:not(.active) {
  background: #e5e5ea;
}

.content {
  padding: 25px;
  max-width: 1000px;
  margin: 0 auto;
}

/* CARDS ESTILO IPHONE */
.card {
  background: #fff;
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.ct {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-black);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.ct::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary-red);
  margin-right: 12px;
  border-radius: 2px;
}

/* INPUTS Y BOTONES */
label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-black);
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  background: #f2f2f7;
  border: 1px solid transparent;
  color: var(--text-black);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 16px; /* Evita zoom en iPhone */
  transition: all 0.2s;
}

input:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.1);
}

.btn {
  background: #f2f2f7;
  border: 1px solid transparent;
  color: var(--text-black);
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  background: #e5e5ea;
}

.btn.primary {
  background: var(--primary-red);
  color: #fff;
}

.btn.primary:hover {
  background: #ff453a;
  transform: scale(1.02);
}

.btn.full { width: 100%; }

/* TABLAS */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 15px;
  color: var(--text-gray);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid #f2f2f7;
}

td {
  padding: 15px;
  border-bottom: 1px solid #f2f2f7;
  font-size: 15px;
}

/* METRICAS */
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.metric {
  background: #f2f2f7;
  padding: 20px;
  border-radius: var(--r);
  text-align: center;
  transition: transform 0.2s;
}

.metric:hover { transform: translateY(-5px); }

.metric .val {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-red);
  display: block;
}

.metric .lbl {
  font-size: 13px;
  color: var(--text-gray);
  font-weight: 500;
}

/* SECCIONES */
.section { display: none; }
.section.active { display: block; animation: slideUp 0.4s ease-out; }

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

@media (max-width: 768px) {
  .row3 { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 18px; }
}
