:root {
    --bg-body: #000000;
    --bg-card: #111111;
    --bg-input: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.4);
    --danger: #ef4444;
    --radius-box: 24px;
    --radius-input: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    padding-bottom: 80px;
    padding-top: env(safe-area-inset-top);
}

header {
    padding: 24px 24px 10px 24px;
    background: var(--bg-body);
    position: sticky;
    top: 0;
    z-index: 50;
}

h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.accent-text {
    color: var(--accent);
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Estimador */
.hero-card {
    background: linear-gradient(180deg, #161616 0%, #050505 100%);
    border-radius: var(--radius-box);
    padding: 30px 20px;
    text-align: center;
    margin: 20px 0 30px 0;
    border: 1px solid #222;
}

.hero-label {
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.hero-value {
    font-size: 60px;
    font-weight: 700;
    letter-spacing: -3px;
    line-height: 1;
    color: #fff;
}

.hero-unit {
    color: var(--accent);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-input {
    background: #222;
    border: 1px solid #333;
    color: #fff;
    padding: 8px 16px;
    border-radius: 50px;
    text-align: center;
    font-size: 14px;
    width: 140px;
}

/* Formulario */
.section-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px 4px;
    color: var(--text-secondary);
}

.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-box);
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid #1a1a1a;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    padding-left: 4px;
}

.input-field {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid #222;
    color: #fff;
    padding: 16px;
    border-radius: var(--radius-input);
    font-size: 18px;
    font-weight: 500;
}

.input-field:focus {
    border-color: var(--accent);
    background: #222;
}

/* Switch */
.switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-input);
    padding: 14px 16px;
    border-radius: var(--radius-input);
    margin-bottom: 24px;
}

.switch-label {
    font-size: 14px;
    font-weight: 500;
}

.switch-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.switch-wrapper input {
    display: none;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: #333;
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

#is-full:checked+.toggle-switch {
    background: var(--accent);
}

#is-full:checked+.toggle-switch::after {
    transform: translateX(20px);
}

.btn-save {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 18px;
    border-radius: var(--radius-input);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-save:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Stats & Charts */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-box);
    text-align: center;
    border: 1px solid #1a1a1a;
}

.stat-val {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.stat-lbl {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 4px;
}

.chart-box {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-box);
    height: 220px;
    margin-bottom: 30px;
    border: 1px solid #1a1a1a;
}

/* Historial */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #1a1a1a;
}

.h-main {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.h-sub {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.h-res {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

.btn-del {
    background: none;
    border: none;
    color: #333;
    font-size: 20px;
    padding-left: 15px;
}

/* Footer Install */
.install-area {
    margin-top: 40px;
    text-align: center;
    display: none;
}

.install-area p {
    color: #444;
    font-size: 12px;
    margin-bottom: 10px;
}

.btn-install-bottom {
    background: #1a1a1a;
    color: var(--accent);
    border: 1px solid #333;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
}

#toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: #222;
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
    border: 1px solid #333;
}

#toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}