:root {
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --accent: #fdcb6e;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #dfe9f3 100%);
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.4);
    --text-main: #2d3436;
    --text-light: #636e72;
    --success: #00b894;
    --radius: 24px;
    --shadow: 0 8px 32px 0 rgba(108, 92, 231, 0.15);
    --font-main: 'Quicksand', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #a29bfe;
        --accent: #fdcb6e;
        --bg-gradient: linear-gradient(135deg, #2d3436 0%, #000000 100%);
        --glass: rgba(45, 52, 54, 0.8);
        --glass-border: rgba(255, 255, 255, 0.1);
        --text-main: #dfe6e9;
        --text-light: #b2bec3;
    }
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Fondo Animado sutil */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(107, 144, 128, 0.1), transparent);
    z-index: -1;
    animation: pulseBg 15s ease-in-out infinite alternate;
}

@keyframes pulseBg {
    from {
        transform: scale(1) translate(0, 0);
    }

    to {
        transform: scale(1.2) translate(5%, 5%);
    }
}

header {
    padding: 20px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo-img {
    height: 40px;
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    padding-bottom: 100px;
}

/* Glass Cards */
.card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(107, 144, 128, 0.3);
    transition: all 0.3s;
}

.btn:active {
    transform: scale(0.96);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}

nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    display: flex;
    justify-content: space-around;
    padding: 12px;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-icon {
    font-size: 1.5rem;
}

/* Emoji Tools */
.emoji-grid {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    margin: 15px 0;
}

.emoji-btn {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--glass-border);
    font-size: 2rem;
    padding: 12px;
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.2s;
}

.emoji-btn:hover {
    transform: scale(1.2);
    background: white;
}

/* Timer */
.timer-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--glass);
    border: 8px solid var(--accent);
    border-top-color: var(--primary);
    margin: 30px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: var(--shadow);
    animation: spin 10s linear infinite;
}

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

.timer-text {
    transform: rotate(-360deg);
}

/* Activity Items */
.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 20px;
    cursor: pointer;
}

.activity-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
}

/* Toast */
#toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(45, 62, 64, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.hidden {
    display: none !important;
}

#sim-banner {
    background: #6c5ce7;
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: bold;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#sim-banner button {
    background: white;
    color: #6c5ce7;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

#sim-banner button:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

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

.role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.role-btn {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 24px 16px;
    border-radius: var(--radius);
    text-align: center;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.role-btn:hover {
    background: white;
    transform: scale(1.02);
}

/* =========================================
   ADMIN DASHBOARD STYLES
   ========================================= */

.stats-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 20px 10px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

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

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-tabs {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    margin: 20px 0;
    padding-bottom: 5px;
    scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 50px;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.admin-action-card {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
    padding: 20px;
    transition: all 0.3s;
}

.admin-action-card:hover {
    transform: translateX(5px);
    border-color: var(--primary);
}

.admin-action-card .icon {
    font-size: 2.5rem;
    background: var(--primary-light);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
}

.admin-action-card .info {
    flex: 1;
}

.admin-action-card .info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-light);
}

.admin-action-card .arrow {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: bold;
}

.badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* =========================================
   LANDING PAGE STYLES
   ========================================= */

.landing-container {
    padding-bottom: 40px;
}

.landing-hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 0 0 40px 40px;
    margin: -24px -24px 30px -24px;
    box-shadow: 0 15px 30px rgba(108, 92, 231, 0.2);
}

.landing-hero h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    color: #152623;
}

.landing-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto 25px auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: var(--glass);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

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

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
}

.pricing-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.price-card {
    background: white;
    padding: 40px 30px;
    border-radius: var(--radius);
    text-align: center;
    position: relative;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

.price-card h3 {
    color: #2D3E40;
    margin-bottom: 10px;
}

.price-card p {
    color: #4A5D5E;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.price-card.featured {
    border-color: var(--primary);
    transform: scale(1.05);
    z-index: 10;
}

.price-tag {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 20px 0;
    color: #2D3E40;
}

.price-tag span {
    font-size: 1rem;
    color: #6D8488;
}

.price-features {
    list-style: none;
    padding: 0;
    margin: 25px 0;
    text-align: left;
}

.price-features li {
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
    color: #2D3E40;
}

.price-features li::before {
    content: "✅";
    position: absolute;
    left: 0;
}

.price-features li.off {
    color: #A0B0AD;
    text-decoration: line-through;
}

.price-features li.off::before {
    content: "❌";
}

.badge-pro {
    background: var(--primary);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.landing-footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}


/* =========================================
   TRACKING & PROGRESS STYLES
   ========================================= */

.tracker-hero {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.2);
}

.chart-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.trend-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    gap: 8px;
    padding-top: 20px;
}

.bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bar {
    width: 100%;
    background: var(--primary-light);
    border-radius: 8px 8px 4px 4px;
    transition: height 1s ease-out;
    position: relative;
    min-height: 10px;
}

.bar.highlight {
    background: var(--primary);
}

.bar::after {
    content: attr(data-value);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--text-main);
}

.bar-label {
    font-size: 0.65rem;
    color: var(--text-light);
    text-align: center;
    font-weight: 600;
}

.insight-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fff;
    padding: 15px;
    border-radius: 18px;
    border-left: 5px solid var(--success);
    margin-bottom: 12px;
}

.insight-card.warning {
    border-left-color: #ff7675;
}

.mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.summary-stat {
    background: var(--glass);
    padding: 15px;
    border-radius: 15px;
    text-align: center;
}

.summary-stat .val {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-stat .lab {
    font-size: 0.7rem;
    color: var(--text-light);
}

/* =========================================
   EMERGENCY ALERT STYLES
   ========================================= */

.btn-emergency {
    background: linear-gradient(135deg, #ff4d4d, #ff0000);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }

    70% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

.btn-emergency:active {
    transform: scale(0.95);
}

.alert-card {
    border-left: 5px solid #ff4d4d !important;
    background: rgba(255, 77, 77, 0.05) !important;
}

.risk-tag {
    background: #ff4d4d;
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}