/* Estilo general NutriGym Tracker */
:root {
    --bg: #050509;
    --bg-elevated: #111119;
    --bg-elevated-soft: #171725;
    --border: #26263a;
    --text: #f5f5ff;
    --muted: #a0a0c0;
    --accent: #32d56b;
    --accent-soft: rgba(50, 213, 107, 0.18);
    --danger: #ff4d67;
    --danger-soft: rgba(255, 77, 103, 0.18);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-pill: 999px;
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.45);
    --shadow-subtle: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #111123 0, #050509 55%, #020206 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header y nav */

.main-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    backdrop-filter: blur(14px);
    background: linear-gradient(to right, rgba(5,5,15,0.95), rgba(5,5,10,0.9));
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 14px;
}

.logo-icon {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 20%, #ffd26f, #ff4e50);
    box-shadow: var(--shadow-subtle);
    font-size: 18px;
}

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

.main-nav {
    display: flex;
    gap: 14px;
    font-size: 14px;
}

.main-nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    transition: all 0.15s ease-out;
}

.main-nav a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.user-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.user-name {
    color: var(--muted);
}

/* Botones */

.btn {
    border-radius: var(--radius-pill);
    padding: 8px 18px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s ease-out, color 0.12s ease-out;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #4cff9a);
    color: #041006;
    box-shadow: 0 12px 30px rgba(50,213,107,0.45);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(50,213,107,0.6);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.14);
    color: var(--text);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
}

/* Layout principal */

.main-content {
    flex: 1;
    padding: 24px 32px 40px;
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
}

.main-footer {
    padding: 14px 24px 22px;
    font-size: 12px;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid rgba(255,255,255,0.04);
    background: rgba(5,5,10,0.95);
}

/* Tarjetas y contenedores */

.card {
    background: radial-gradient(circle at top left, #252545 0, #141426 45%, #111119 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.06);
    padding: 18px 20px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at top right, rgba(50,213,107,0.16), transparent 55%);
    opacity: 0.7;
    pointer-events: none;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.card .subtitle {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--muted);
}

/* Páginas */

.page-title {
    font-size: 26px;
    margin: 4px 0 4px;
}

.page-subtitle {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

/* Grids */

.grid-2 {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 18px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.grid-3.align-start {
    align-items: flex-start;
}

.grid-3.compact label,
.grid-2.compact label {
    font-size: 12px;
}

.grid-2.compact,
.grid-3.compact {
    gap: 10px;
}

/* Formularios */

.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

input,
select {
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(4,4,12,0.9);
    color: var(--text);
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    transition: border 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s ease-out;
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(50,213,107,0.4);
    background: rgba(4,4,14,1);
}

/* Auth */

.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;          /* que ocupe el espacio libre */
    min-height: 0;    /* o simplemente borra esta línea */
}

.auth-card {
    max-width: 380px;
    width: 100%;
}

.subtitle {
    font-size: 13px;
    color: var(--muted);
}

/* Alertas */

.alert {
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 10px;
}

.alert-error {
    background: var(--danger-soft);
    border: 1px solid rgba(255,77,103,0.6);
}

/* Tablas */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    background: rgba(255,255,255,0.04);
}

th,
td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

th {
    font-weight: 500;
    color: var(--muted);
}

tr:hover td {
    background: rgba(255,255,255,0.02);
}

td.actions a {
    font-size: 12px;
    margin-right: 6px;
    color: var(--accent);
    text-decoration: none;
}

td.actions a:hover {
    text-decoration: underline;
}

/* Stats y textos */

.big-number {
    font-size: 32px;
    font-weight: 700;
    margin: 2px 0;
}

.stats-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    font-size: 13px;
}

.stats-list li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.stats-list li:last-child {
    border-bottom: none;
}

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

.mt-md { margin-top: 10px; }
.mt-lg { margin-top: 18px; }
.mt-sm { margin-top: 6px; }

/* Days strip */

.days-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.day-pill {
    min-width: 70px;
    padding: 8px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255,255,255,0.14);
    text-decoration: none;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    background: rgba(10,10,20,0.9);
    transition: all 0.12s ease-out;
}

.day-pill .day-name {
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.day-pill .day-date {
    font-size: 13px;
    font-weight: 600;
}

.day-pill.active {
    border-color: var(--accent);
    color: var(--text);
    background: var(--accent-soft);
    box-shadow: 0 8px 24px rgba(50,213,107,0.4);
}

.day-pill:hover {
    transform: translateY(-1px);
}

.day-picker input[type="date"] {
    font-size: 11px;
}

/* Progreso circular */

.progress-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    margin: 4px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-subtle);
    border: 4px solid #050510;
}

.progress-inner {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle at top, #17172a, #050509);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}

/* Tags */

.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.06);
    font-size: 11px;
    margin-left: 6px;
}

.tag-success {
    background: var(--accent-soft);
    color: var(--accent);
}

.tag-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

/* Perfil */

.profile-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
}

.profile-list li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.profile-list li:last-child {
    border-bottom: none;
}

/* Card header inline */

.card-header-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inline-form input {
    max-width: 140px;
}

/* Utilidades */

@media (max-width: 900px) {
    .main-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    .user-area {
        order: 2;
    }
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .main-content {
        padding: 18px 16px 32px;
    }
    .progress-circle {
        margin-top: 12px;
    }
}
