:root {
    --bg-dark: #0a0705;
    --space-dark: #120a07;
    --neon-cyan: #2d5a27;
    --neon-blue: #c0a172;
    --neon-glow: rgba(45, 90, 39, 0.4);
    --glass-bg: rgba(20, 15, 12, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-emerald: #2d5a27;
    --accent-blue: #c0a172;
    --accent-green: #40916c;
    --accent-red: #ae2012;
    --accent-yellow: #ee9b00;
    --accent-orange: #f3722c;
    --accent-celeste: #4cc9f0;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --nav-bg: rgba(18, 10, 7, 0.8);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: transparent;
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    background-color: #0c0806;
    background-image: url('coffee_bg.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.main-header {
    padding: 1.25rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    background: rgba(18, 10, 7, 0.4);
}

.logo {
    display: flex;
    align-items: center;
}

.status-indicators {
    display: flex;
    gap: 0.4rem;
}

.indicator {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    border-radius: 99px;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-weight: 500;
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    animation: slideDown 0.4s ease-out;
}

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

.header-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.content-view {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    padding-bottom: 6rem;
    scrollbar-width: none;
}

.content-view::-webkit-scrollbar {
    display: none;
}

.card {
    background: rgba(18, 10, 7, 0.05);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 2.25rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        -5px -5px 25px rgba(45, 90, 39, 0.15),
        0 0 15px rgba(45, 90, 39, 0.05),
        inset 0 0 10px rgba(255, 255, 255, 0.02);
}

/* Card Destello Effect */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 2.25rem;
    padding: 1.5px;
    background: conic-gradient(
        from var(--shimmer-angle, 0deg),
        transparent 70%,
        rgba(255, 255, 255, 0.2) 80%,
        rgba(255, 255, 255, 1) 90%,
        rgba(255, 255, 255, 0.2) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: neonShimmer 4s linear infinite;
    pointer-events: none;
    opacity: 1;
}

@property --shimmer-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes neonShimmer {
    0% { --shimmer-angle: 0deg; }
    100% { --shimmer-angle: 360deg; }
}

.card:active { transform: scale(0.98); }

.bottom-nav {
    position: fixed;
    bottom: 0px;
    left: 1rem;
    right: 1rem;
    margin-bottom: 1.25rem;
    height: 4.75rem;
    background: rgba(18, 10, 7, 0.15) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border: 1px solid var(--glass-border);
    border-radius: 2.5rem;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 0 0 20px rgba(45, 90, 39, 0.1);
}

nav.bottom-nav .nav-item {
    background: none !important;
    border: none !important;
    color: var(--text-secondary) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    padding: 0.5rem 1rem !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 1.5rem !important;
    min-width: 60px !important;
}

nav.bottom-nav .nav-item.active {
    color: var(--neon-blue) !important;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 99px;
    border: none;
    font-weight: 800;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(90deg, #2d5a27, #1b4332);
    color: white;
    box-shadow: 0 0 20px rgba(45, 90, 39, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.action-main {
    background: linear-gradient(135deg, #2d5a27, #1b4332);
    padding: 2.5rem 1.5rem;
    border-radius: 2rem;
    text-align: center;
    cursor: pointer;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 15px rgba(45, 90, 39, 0.2);
}

.action-label {
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: white;
}

/* Premium Level Selector */
.level-selector-premium {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.level-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
}

.level-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
}

.level-card span {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-card small {
    font-size: 0.55rem;
    opacity: 0.6;
}

.level-card.active.nulo { background: #374151; border-color: #94a3b8; color: white; box-shadow: 0 0 15px rgba(148, 163, 184, 0.3); }
.level-card.active.bajo { background: #2d6a4f; border-color: #52b788; color: white; box-shadow: 0 0 15px rgba(82, 183, 136, 0.3); }
.level-card.active.medio { background: #b45309; border-color: #f59e0b; color: white; box-shadow: 0 0 15px rgba(245, 158, 11, 0.3); }
.level-card.active.alto { background: #9b2226; border-color: #dc2f02; color: white; box-shadow: 0 0 15px rgba(220, 47, 2, 0.3); }

/* Threshold Indicators */
.threshold-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
}

.threshold-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.threshold-dot.green.active { background: #52b788; box-shadow: 0 0 8px #52b788; }
.threshold-dot.yellow.active { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.threshold-dot.red.active { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

/* Icon Badges */
.pest-icon-badge, .disease-icon-badge, .weed-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: transform 0.2s;
}

.pest-icon-badge:hover, .disease-icon-badge:hover, .weed-icon-badge:hover { transform: scale(1.05); }

/* Modals */
.threshold-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center; z-index: 10000;
    opacity: 0; transition: opacity 0.3s; padding: 1.5rem;
}
.threshold-modal-overlay.active { opacity: 1; }
.threshold-modal-card {
    background: #120a07; border: 1px solid var(--glass-border); border-radius: 2rem;
    width: 100%; max-width: 500px; padding: 1.5rem;
    transform: translateY(20px); transition: transform 0.3s;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.threshold-modal-overlay.active .threshold-modal-card { transform: translateY(0); }

.threshold-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.threshold-table th { text-align: left; font-size: 0.65rem; color: var(--text-secondary); padding: 0.5rem; text-transform: uppercase; letter-spacing: 1px; }
.threshold-table td { padding: 0.75rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.8rem; }

/* Monitoring specific */
.monitor-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(18, 10, 7, 0.1);
    backdrop-filter: blur(25px);
    padding: 0.6rem;
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 1rem;
    transition: all 0.3s;
}

.step-item.active {
    background: linear-gradient(135deg, #2d5a27, #c0a172);
    color: white;
}

.input-modern {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1rem;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}
.btn-orange { 
    background: rgba(243, 114, 44, 0.15) !important; 
    border: 1px solid rgba(243, 114, 44, 0.4) !important; 
    color: #f3722c !important; 
    backdrop-filter: blur(10px);
}
.btn-celeste { 
    background: rgba(76, 201, 240, 0.15) !important; 
    border: 1px solid rgba(76, 201, 240, 0.4) !important; 
    color: #4cc9f0 !important; 
    backdrop-filter: blur(10px);
}
.dashboard-greeting { display: flex; align-items: center; gap: 0.5rem; font-size: 1.1rem; margin-top: 0.5rem; }
.dashboard-title-mini { font-size: 0.8rem; text-transform: uppercase; color: var(--accent-blue); letter-spacing: 2px; font-weight: 800; }

.admin-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }
.admin-card-btn {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 1.5rem !important;
    padding: 1.25rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 1.25rem !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-align: left !important;
    position: relative !important;
    overflow: hidden !important;
}
.admin-card-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    padding: 1.5px;
    background: conic-gradient(
        from var(--shimmer-angle, 0deg),
        transparent 70%,
        rgba(255, 255, 255, 0.2) 80%,
        rgba(255, 255, 255, 1) 90%,
        rgba(255, 255, 255, 0.2) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: neonShimmer 4s linear infinite;
    pointer-events: none;
    opacity: 1;
}
.admin-card-btn.celeste { background: rgba(76, 201, 240, 0.15) !important; border-color: rgba(76, 201, 240, 0.3) !important; }
.admin-card-btn.celeste .admin-card-icon { color: #4cc9f0; }

.admin-card-btn.green { background: rgba(64, 145, 108, 0.15) !important; border-color: rgba(64, 145, 108, 0.3) !important; }
.admin-card-btn.green .admin-card-icon { color: #40916c; }

.admin-card-btn.blue { background: rgba(0, 180, 216, 0.15) !important; border-color: rgba(0, 180, 216, 0.3) !important; }
.admin-card-btn.blue .admin-card-icon { color: #00b4d8; }

.admin-card-btn.red { background: rgba(174, 32, 18, 0.15) !important; border-color: rgba(174, 32, 18, 0.3) !important; }
.admin-card-btn.red .admin-card-icon { color: #ae2012; }

.admin-card-btn.yellow { background: rgba(238, 155, 0, 0.15) !important; border-color: rgba(238, 155, 0, 0.3) !important; }
.admin-card-btn.yellow .admin-card-icon { color: #ee9b00; }

.admin-card-btn:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.2) !important; }
.admin-card-icon {
    width: 48px; height: 48px; border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-blue); font-size: 1.5rem;
}
.admin-card-content { flex: 1; }
.admin-card-title { font-weight: 800; font-size: 1rem; color: white; display: block; }
.admin-card-subtitle { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.1rem; }

.admin-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.admin-title-wrap { display: flex; align-items: center; gap: 0.75rem; }
.btn-icon-only { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); color: white; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-icon-only.delete { color: #ef4444; }

/* Dashboard Additions */
.status-pill {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
    margin-top: 1rem;
}
.status-pill.has-pending {
    background: rgba(192, 161, 114, 0.08);
    border-color: rgba(192, 161, 114, 0.3);
}
.status-info strong { display: block; font-size: 0.85rem; color: var(--accent-blue); }
.status-info span { font-size: 0.7rem; opacity: 0.6; }

.install-card { margin-top: 1.5rem; text-align: center; background: rgba(45, 90, 39, 0.1); border-color: rgba(45, 90, 39, 0.3); }

/* Premium Records View */
.record-card {
    padding: 1.5rem;
    border-radius: 1.75rem;
    margin-bottom: 1.25rem;
}
.record-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.record-info { display: flex; gap: 0.75rem; align-items: center; }
.record-icon-wrap { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; color: var(--accent-blue); }
.record-title { font-weight: 800; font-size: 1rem; color: white; }
.record-meta { font-size: 0.7rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.4rem; margin-top: 0.2rem; }
.record-status-badge { font-size: 0.6rem; padding: 0.25rem 0.6rem; border-radius: 6px; font-weight: 800; }
.record-status-badge.pending { background: #b45309; color: white; }
.record-status-badge.synced { background: #059669; color: white; }

.record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; font-size: 0.75rem; }
.record-coords { font-size: 0.7rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.4rem; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); }

.record-details { margin-top: 1rem; }
.record-detail-section { margin-bottom: 0.75rem; }
.record-detail-label { font-size: 0.65rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.4rem; }
.record-detail-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Custom chip styles for coffee */
.chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.6rem; border-radius: 99px; font-size: 0.65rem; font-weight: 700; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); }
.chip.low { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.4); color: #10b981; }
.chip.medium { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.4); color: #f59e0b; }
.chip.high { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #ef4444; }

.record-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.05); }

.pending-summary-card { background: rgba(192, 161, 114, 0.15); border: 1px solid rgba(192, 161, 114, 0.4); text-align: center; }
.neon-text { color: var(--accent-blue); font-weight: 900; }
