@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

/* Campana de notificaciones en topbar */
.blv-notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #fff;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.18);
    text-decoration: none;
    transition: all 0.18s ease;
    margin-right: 6px;
}
.blv-notif-bell:hover {
    background: rgba(245,158,11,0.25);
    border-color: rgba(245,158,11,0.55);
    transform: translateY(-1px);
}
.blv-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 0 0 2px #064e3b, 0 4px 10px rgba(220,38,38,0.4);
    animation: blvNotifPulse 2s ease-in-out infinite;
}
@keyframes blvNotifPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

/* Pagina de notificaciones */
.blv-notif-list { display: flex; flex-direction: column; gap: 10px; }
.blv-notif-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    border-left: 4px solid #cbd5e1;
    transition: all 0.18s ease;
}
.blv-notif-card.no-leida {
    border-left-color: #f59e0b;
    background: linear-gradient(180deg, #fffbeb, #fff);
}
.blv-notif-card:hover { transform: translateX(2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.blv-notif-card .ic {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: #f0fdf4;
    font-size: 20px;
    flex-shrink: 0;
}
.blv-notif-card.no-leida .ic { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.blv-notif-card .body { flex: 1; min-width: 0; }
.blv-notif-card .body h4 { margin: 0 0 4px; color: #14532d; font-size: 14px; }
.blv-notif-card .body .meta { font-size: 11px; color: #94a3b8; margin-top: 6px; }
.blv-notif-card .body .msg { font-size: 13px; color: #475569; line-height: 1.4; }
.blv-notif-card .acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.blv-notif-empty {
    padding: 60px 30px;
    text-align: center;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    color: #64748b;
}
.blv-notif-empty .ic { font-size: 56px; margin-bottom: 8px; }
.blv-notif-empty h3 { color: #14532d; margin: 6px 0; }

:root {
    --blv-bg-main: linear-gradient(160deg, #04181a 0%, #0c3a32 44%, #1f7a5e 100%);
    --blv-text: #0e2620;
    --blv-text-light: #eafff7;
    --blv-muted: #46716a;
    --blv-border: rgba(132, 200, 175, 0.55);
    --blv-primary: linear-gradient(135deg, #047857 0%, #16a34a 55%, #22c55e 100%);
    --blv-primary-flat: #15803d;
    --blv-accent: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --blv-glow-a: rgba(34, 197, 94, 0.45);
    --blv-glow-b: rgba(6, 182, 212, 0.32);
    --blv-glow-c: rgba(245, 158, 11, 0.22);
    --blv-shadow-soft: 0 14px 30px rgba(4, 24, 18, 0.18);
    --blv-shadow-strong: 0 26px 60px rgba(4, 16, 10, 0.45);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.blv-body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    color: var(--blv-text);
    background: var(--blv-bg-main);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

/* ========== Fondo decorativo ========== */
.blv-bg {
    position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
}
.blv-bg-blob {
    position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.65;
    animation: blvFloat 14s ease-in-out infinite;
}
.blv-bg-blob.a { width: 540px; height: 540px; top: -120px; right: -120px; background: radial-gradient(circle, var(--blv-glow-a), transparent 70%); }
.blv-bg-blob.b { width: 600px; height: 600px; bottom: -200px; left: -180px; background: radial-gradient(circle, var(--blv-glow-b), transparent 70%); animation-delay: -5s; }
.blv-bg-blob.c { width: 380px; height: 380px; top: 35%; left: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, var(--blv-glow-c), transparent 70%); animation-delay: -8s; }

@keyframes blvFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

/* ========== Containers ========== */
.blv-container {
    position: relative; z-index: 2;
    max-width: 1320px; margin: 0 auto;
    padding: 28px 22px 60px;
}
.blv-container-narrow { max-width: 720px; }

.blv-landing {
    position: relative; z-index: 2;
    max-width: 1280px; margin: 0 auto;
    padding: 40px 26px 60px;
    display: flex; flex-direction: column; gap: 30px;
}

/* ========== Hero ========== */
.blv-hero { color: var(--blv-text-light); text-align: center; }
.blv-hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 14px; border-radius: 999px;
    color: #d1fae5; font-size: 13px; font-weight: 600; letter-spacing: 0.3px;
    backdrop-filter: blur(8px);
}
.blv-hero-badge .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #22c55e; box-shadow: 0 0 12px #22c55e;
    animation: blvPulse 1.6s infinite;
}
@keyframes blvPulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }
.blv-hero-title {
    font-size: clamp(2rem, 1.5rem + 2.5vw, 3.4rem);
    margin: 18px 0 10px; color: #fff; font-weight: 800; letter-spacing: -1px;
}
.blv-grad {
    background: linear-gradient(135deg, #4ade80 0%, #facc15 50%, #38bdf8 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.blv-hero-sub {
    color: #c1f0dc; font-size: clamp(0.95rem, 0.85rem + 0.4vw, 1.15rem);
    max-width: 760px; margin: 0 auto; line-height: 1.55;
}

/* ========== Glass / cards ========== */
.blv-glass, .blv-card {
    position: relative; isolation: isolate; overflow: hidden;
    border-radius: 22px; padding: 24px;
    background: linear-gradient(165deg, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.04) 100%);
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 30px 60px rgba(2,18,12,0.4), inset 0 1px 0 rgba(255,255,255,0.18);
    color: var(--blv-text-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.blv-glass:hover { transform: translateY(-3px); }

.blv-card-glass { color: var(--blv-text-light); }

.blv-card.blv-card-light {
    background: linear-gradient(165deg, rgba(255,255,255,0.97) 0%, rgba(238,253,247,0.94) 100%);
    color: var(--blv-text);
    border: 1px solid rgba(34,197,94,0.18);
    box-shadow: var(--blv-shadow-soft);
}

.blv-split {
    display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; align-items: stretch;
}

/* ========== Hero info card ========== */
.blv-card-info .blv-logos {
    display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.blv-card-info .blv-logos img {
    background: rgba(255,255,255,0.95); border-radius: 16px; padding: 8px 14px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.3); height: 88px; width: auto;
}
.blv-feat-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px; margin-top: 6px;
}
.blv-feat {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: 14px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s ease;
}
.blv-feat:hover { background: rgba(255,255,255,0.1); }
.blv-feat-ic {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center; flex-shrink: 0;
}
.blv-feat strong { display: block; font-size: 14.5px; color: #fff; font-weight: 700; }
.blv-feat span { font-size: 12px; color: #b6e0d0; }

.blv-actions-hero { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* ========== Buttons ========== */
.blv-btn {
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
    border: 1px solid transparent; border-radius: 13px;
    padding: 11px 18px; font-size: 14.5px; font-weight: 700;
    cursor: pointer; text-decoration: none;
    background: rgba(255,255,255,0.1); color: #fff;
    transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease;
    font-family: inherit; line-height: 1.1;
}
.blv-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.blv-btn-primary {
    background: var(--blv-primary); color: #fff;
    box-shadow: 0 14px 28px rgba(22,163,74,0.38), inset 0 1px 0 rgba(255,255,255,0.25);
}
.blv-btn-outline {
    background: transparent; color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
}
.blv-btn-outline:hover { background: rgba(255,255,255,0.1); }
.blv-btn-block { width: 100%; }
.blv-btn-danger {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%); color: #fff;
    box-shadow: 0 10px 22px rgba(185,28,28,0.4);
}
.blv-btn-warn {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%); color: #fff;
}
.blv-btn-info {
    background: linear-gradient(135deg, #0e7490 0%, #06b6d4 100%); color: #fff;
}
.blv-btn-ghost {
    background: rgba(255,255,255,0.85); color: #14532d; border: 1px solid #d1fae5;
}
.blv-btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.blv-btn-icon { width: 36px; height: 36px; padding: 0; }

/* ========== Auth card ========== */
.blv-card-auth { display: flex; flex-direction: column; gap: 18px; }
.blv-auth-head h2 { margin: 0 0 4px; color: #fff; font-size: 22px; }
.blv-muted { color: #b6e0d0; font-size: 13px; }

.blv-form { display: flex; flex-direction: column; gap: 14px; }

.blv-field {
    position: relative; display: block;
}
.blv-field input,
.blv-field textarea,
.blv-field select {
    width: 100%; padding: 16px 14px 8px;
    background: rgba(255,255,255,0.92); color: var(--blv-text);
    border: 1px solid rgba(255,255,255,0.3); border-radius: 12px;
    font-size: 14.5px; font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.blv-field input:focus,
.blv-field textarea:focus,
.blv-field select:focus {
    outline: none; border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.25);
}
.blv-field label {
    position: absolute; left: 14px; top: 14px;
    color: #6b7e75; font-size: 13.5px; font-weight: 600;
    pointer-events: none;
    transition: all 0.18s ease; background: transparent;
}
.blv-field input:focus + label,
.blv-field input:not(:placeholder-shown) + label,
.blv-field textarea:focus + label,
.blv-field textarea:not(:placeholder-shown) + label,
.blv-field select:focus + label,
.blv-field select:not([value=""]) + label {
    top: 4px; font-size: 11px; color: #15803d;
}
.blv-field-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: transparent; border: none; cursor: pointer; color: #5d7a72;
    padding: 6px; border-radius: 8px;
}
.blv-field-toggle:hover { color: #14532d; background: rgba(34,197,94,0.1); }

.blv-auth-foot {
    margin-top: 4px; padding-top: 14px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    border-top: 1px dashed rgba(255,255,255,0.2);
    font-size: 13px; color: #b6e0d0;
}
.blv-auth-foot a { color: #fde68a; font-weight: 700; text-decoration: none; }
.blv-auth-foot a:hover { text-decoration: underline; }
.blv-auth-foot img {
    background: rgba(255,255,255,0.92); border-radius: 12px; padding: 6px 12px;
    height: 60px; box-shadow: 0 8px 18px rgba(0,0,0,0.3);
}

/* ========== Alerts ========== */
.blv-alert {
    padding: 11px 14px; border-radius: 12px; font-size: 14px; font-weight: 600;
    border: 1px solid transparent; margin-bottom: 4px;
}
.blv-alert.ok    { background: rgba(34,197,94,0.18); color: #d1fae5; border-color: rgba(34,197,94,0.4); }
.blv-alert.error { background: rgba(239,68,68,0.18); color: #fecaca; border-color: rgba(239,68,68,0.4); }
.blv-alert.warn  { background: rgba(245,158,11,0.18); color: #fde68a; border-color: rgba(245,158,11,0.4); }
.blv-alert.info  { background: rgba(6,182,212,0.18); color: #a5f3fc; border-color: rgba(6,182,212,0.4); }

.blv-card.blv-card-light .blv-alert.ok    { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.blv-card.blv-card-light .blv-alert.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ========== Topbar (app interna) ========== */
.blv-topbar {
    position: relative; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 14px 26px; flex-wrap: wrap;
    background: linear-gradient(165deg, rgba(2, 24, 18, 0.85) 0%, rgba(4, 38, 28, 0.7) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    color: var(--blv-text-light);
}
.blv-topbar-brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.blv-topbar-brand img {
    background: rgba(255,255,255,0.95); border-radius: 12px; padding: 4px 10px;
    height: 50px; width: auto;
    box-shadow: 0 8px 18px rgba(0,0,0,0.3);
}
.blv-topbar-brand h1 {
    margin: 0; font-size: 18px; color: #fff; font-weight: 800; line-height: 1.1;
}
.blv-topbar-brand small { color: #a7f3d0; font-size: 12px; }

.blv-topbar-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.blv-nav-link {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 14px; border-radius: 10px;
    color: #ffffff; font-size: 13.5px; font-weight: 700;
    text-decoration: none; letter-spacing: 0.2px;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.18);
    transition: transform .15s, background .2s, border-color .2s, box-shadow .2s, color .2s;
    text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.blv-nav-link svg { stroke: currentColor; opacity: 0.95; }
.blv-nav-link:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}
.blv-nav-link.active {
    background: linear-gradient(135deg, #15803d, #22c55e);
    color: #fff;
    border-color: #4ade80;
    box-shadow: 0 6px 18px rgba(34,197,94,0.45), inset 0 -2px 0 rgba(0,0,0,0.18);
}

/* Color especifico (borde + acento) por pagina */
.blv-nav-link[href*="p=dashboard"]     { border-color: rgba(34,197,94,0.55); }
.blv-nav-link[href*="p=usuarios"]      { border-color: rgba(96,165,250,0.6);  }
.blv-nav-link[href*="p=categorias"]    { border-color: rgba(168,85,247,0.6);  }
.blv-nav-link[href*="p=especies"]      { border-color: rgba(251,146,60,0.6);  }
.blv-nav-link[href*="p=bitacora"]      { border-color: rgba(244,114,182,0.6); }
.blv-nav-link[href*="p=diario"]        { border-color: rgba(56,189,248,0.6);  }
.blv-nav-link[href*="p=mapa"]          { border-color: rgba(45,212,191,0.6);  }
.blv-nav-link[href*="p=capas_kml"]     { border-color: rgba(132,204,22,0.65); }
.blv-nav-link[href*="p=calendario"]    { border-color: rgba(250,204,21,0.6);  }
.blv-nav-link[href*="p=galeria"]       { border-color: rgba(232,121,249,0.6); }
.blv-nav-link[href*="p=alertas_riego"] { border-color: rgba(248,113,113,0.7); background: rgba(248,113,113,0.12); }
.blv-nav-link[href*="p=reporte"]       { border-color: rgba(163,230,53,0.6);  }
.blv-nav-link[href*="p=informes_mensuales"] { border-color: rgba(96,165,250,0.7); background: rgba(59,130,246,0.10); }
.blv-nav-link[href*="p=kiosko"]        { border-color: rgba(192,132,252,0.6); }
.blv-nav-link[href*="p=mi_perfil"]     { border-color: rgba(125,211,252,0.55); }

/* Cuando esta activo, el degradado verde manda */
.blv-nav-link.active { border-color: #4ade80 !important; }

.blv-topbar-user {
    display: flex; align-items: center; gap: 10px;
}
.blv-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #047857, #22c55e);
    display: grid; place-items: center; color: #fff; font-weight: 800;
    overflow: hidden; border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.blv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.blv-avatar.lg { width: 88px; height: 88px; font-size: 28px; }
.blv-avatar.xl { width: 130px; height: 130px; font-size: 40px; }

/* ========== KPIs ========== */
.blv-kpis {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px; margin-bottom: 20px;
}
.blv-kpi {
    position: relative; overflow: hidden;
    background: linear-gradient(165deg, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.04) 100%);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 16px; padding: 16px;
    backdrop-filter: blur(12px);
    color: #fff;
    display: flex; align-items: center; gap: 14px;
}
.blv-kpi-ic {
    width: 50px; height: 50px; border-radius: 14px;
    display: grid; place-items: center; flex-shrink: 0;
}
.blv-kpi strong { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; color: #fff; }
.blv-kpi span { font-size: 12.5px; color: #a7f3d0; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }

/* ========== Charts ========== */
.blv-charts {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}
.blv-chart-card {
    background: rgba(255,255,255,0.95); color: var(--blv-text);
    border-radius: 16px; padding: 14px;
    border: 1px solid rgba(34,197,94,0.18);
    box-shadow: var(--blv-shadow-soft);
}
.blv-chart-card h3 { margin: 0 0 10px; color: #14532d; font-size: 15px; font-weight: 700; }
.blv-chart-box { position: relative; height: 240px; }

/* ========== Tables ========== */
.blv-table-wrap {
    background: rgba(255,255,255,0.97); color: var(--blv-text);
    border-radius: 16px; overflow: hidden;
    border: 1px solid rgba(34,197,94,0.18);
    box-shadow: var(--blv-shadow-soft);
}
.blv-table-scroll { overflow-x: auto; }
.blv-table {
    width: 100%; border-collapse: collapse; min-width: 720px;
}
.blv-table th, .blv-table td {
    padding: 12px 14px; text-align: left; vertical-align: middle;
    border-bottom: 1px solid #ecfdf5; font-size: 14px;
}
.blv-table th {
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
    color: #14532d; font-size: 13px; text-transform: uppercase; letter-spacing: 0.3px;
    font-weight: 700;
}
.blv-table tbody tr:hover { background: #f0fdf4; }
.blv-table .blv-row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }

.blv-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
    border: 1px solid transparent;
}
.blv-pill.fauna     { background:#fef3c7; color:#92400e; border-color:#fde68a; }
.blv-pill.flora     { background:#dcfce7; color:#166534; border-color:#86efac; }
.blv-pill.hidrica   { background:#cffafe; color:#155e75; border-color:#67e8f9; }
.blv-pill.suelo     { background:#fef9c3; color:#854d0e; border-color:#fde047; }
.blv-pill.clima     { background:#dbeafe; color:#1e3a8a; border-color:#93c5fd; }
.blv-pill.otra      { background:#ede9fe; color:#5b21b6; border-color:#c4b5fd; }
.blv-pill.activa    { background:#dcfce7; color:#166534; border-color:#86efac; }
.blv-pill.enfermo   { background:#fef3c7; color:#92400e; border-color:#fde68a; }
.blv-pill.muerta    { background:#fee2e2; color:#991b1b; border-color:#fecaca; }
.blv-pill.reubicada { background:#dbeafe; color:#1e3a8a; border-color:#93c5fd; }
.blv-pill.admin     { background:#fce7f3; color:#9d174d; border-color:#f9a8d4; }
.blv-pill.usuario   { background:#dcfce7; color:#166534; border-color:#86efac; }
.blv-pill.ok        { background:#dcfce7; color:#166534; }
.blv-pill.no        { background:#fee2e2; color:#991b1b; }

/* ========== Section header ========== */
.blv-section-head {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    flex-wrap: wrap; margin-bottom: 18px;
    color: var(--blv-text-light);
}
.blv-section-head h2 { margin: 0; color: #fff; font-size: 24px; }
.blv-section-head p { margin: 4px 0 0; color: #b6e0d0; font-size: 14px; }
.blv-section-head .blv-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ========== Forms inside light cards ========== */
.blv-card.blv-card-light .blv-field input,
.blv-card.blv-card-light .blv-field textarea,
.blv-card.blv-card-light .blv-field select {
    background: #fff; border: 1px solid #d1fae5; color: var(--blv-text);
}
.blv-card.blv-card-light .blv-field label { color: #46716a; }

.blv-form-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.blv-form-grid .full { grid-column: 1 / -1; }

.blv-form-actions {
    display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end;
    margin-top: 14px; padding-top: 14px;
    border-top: 1px dashed #d1fae5;
}

/* ========== Modal ========== */
.blv-modal-overlay {
    position: fixed; inset: 0; background: rgba(2,12,8,0.75);
    backdrop-filter: blur(6px);
    display: none; align-items: flex-start; justify-content: center;
    z-index: 1000; padding: 4vh 16px; overflow-y: auto;
}
.blv-modal-overlay.active { display: flex; }
.blv-modal {
    width: 100%; max-width: 640px; border-radius: 22px;
    background: linear-gradient(165deg, #ffffff 0%, #f0fdf4 100%);
    color: var(--blv-text);
    padding: 22px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    animation: blvModalIn 0.3s cubic-bezier(.2,.9,.3,1.2);
    border: 1px solid rgba(34,197,94,0.25);
}
@keyframes blvModalIn { from { transform: scale(0.94) translateY(20px); opacity:0;} to {transform: scale(1) translateY(0); opacity:1;} }
.blv-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed #d1fae5; }
.blv-modal-head h3 { margin: 0; font-size: 18px; color: #14532d; }
.blv-modal-close {
    width: 36px; height: 36px; border-radius: 10px; border: none;
    background: #fee2e2; color: #991b1b; cursor: pointer;
    display: grid; place-items: center; font-size: 18px;
}

/* ========== Logos row in dashboard ========== */
.blv-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; justify-content: center; }
.blv-logo-main, .blv-logo-side, .blv-logo-bottom {
    display: block; background: rgba(255,255,255,0.94);
    border-radius: 13px; padding: 6px 10px;
    box-shadow: 0 9px 18px rgba(0,0,0,0.18);
}
.blv-logo-main { max-height: 90px; }
.blv-logo-side { max-height: 80px; }
.blv-link { display: inline-block; margin-top: 12px; color: #fde68a; font-weight: 700; text-decoration: none; }
.blv-link:hover { text-decoration: underline; }

h1, h2, h3 { font-family: inherit; }
.blv-card-glass h1, .blv-card-glass h2, .blv-card-glass h3 { color: #fff; }
.blv-card-glass p, .blv-card-glass label { color: #c1f0dc; }

/* ========== Excel-like grid ========== */
.blv-excel-wrap {
    background: rgba(255,255,255,0.97); color: var(--blv-text);
    border-radius: 16px; padding: 16px;
    border: 1px solid rgba(34,197,94,0.18);
    box-shadow: var(--blv-shadow-soft);
}
.blv-excel-toolbar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px;
    padding-bottom: 12px; border-bottom: 1px dashed #d1fae5;
}
.blv-excel-toolbar input,
.blv-excel-toolbar select {
    padding: 9px 12px; border: 1px solid #d1fae5; border-radius: 10px;
    font-size: 14px; font-family: inherit; background: #fff;
}
.blv-excel {
    width: 100%; border-collapse: collapse;
    font-size: 13.5px;
}
.blv-excel thead th {
    background: linear-gradient(180deg, #d1fae5 0%, #a7f3d0 100%);
    color: #064e3b; padding: 10px 8px; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.3px; font-weight: 700;
    border: 1px solid #6ee7b7; position: sticky; top: 0; z-index: 1;
}
.blv-excel tbody td {
    padding: 8px 10px; border: 1px solid #d1fae5; vertical-align: middle;
    background: #fff;
}
.blv-excel tbody tr:nth-child(even) td { background: #f0fdf4; }
.blv-excel tbody tr:hover td { background: #d1fae5; }
.blv-excel .codigo {
    font-family: 'Courier New', monospace; font-weight: 800;
    background: linear-gradient(135deg, #064e3b, #047857); color: #fff;
    text-align: center; padding: 6px 10px; border-radius: 8px; min-width: 50px;
    display: inline-block; font-size: 13px;
}
.blv-excel-photo {
    width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
    background: #ecfdf5; border: 1px solid #d1fae5;
}
.blv-excel-photo.placeholder {
    display: grid; place-items: center; color: #16a34a; font-size: 20px;
}

/* ========== Diary grid (riego) ========== */
.blv-diary-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.blv-diary-card {
    background: linear-gradient(165deg, rgba(255,255,255,0.97), rgba(240,253,244,0.94));
    border-radius: 16px; padding: 14px;
    border: 1px solid rgba(34,197,94,0.2);
    box-shadow: var(--blv-shadow-soft);
    color: var(--blv-text);
    display: flex; flex-direction: column; gap: 10px;
    transition: transform 0.2s ease;
    min-width: 0;
    overflow: hidden;
}
.blv-diary-card:hover { transform: translateY(-3px); }
.blv-diary-head {
    display: flex; align-items: center; gap: 10px;
    min-width: 0;
}
.blv-diary-head .codigo {
    background: linear-gradient(135deg, #064e3b, #047857); color: #fff;
    font-family: 'Courier New', monospace; font-weight: 800;
    padding: 4px 9px; border-radius: 8px; font-size: 13px;
    flex-shrink: 0;
}
.blv-diary-head h4 {
    margin: 0; font-size: 15px; color: #14532d; line-height: 1.2;
    min-width: 0; flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.blv-diary-head h4 small {
    display: block; font-style: italic; font-size: 12px; color: #46716a; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.blv-diary-photo {
    width: 100%; height: 140px; border-radius: 12px;
    background: #d1fae5; object-fit: cover; border: 1px solid #a7f3d0;
    display: block;
}
.blv-diary-meta {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    font-size: 12px; color: #46716a;
    min-width: 0;
}
.blv-diary-meta > div { min-width: 0; overflow: hidden; }
.blv-diary-meta strong { color: #14532d; }

.blv-diary-form {
    display: grid; gap: 8px; padding-top: 10px; border-top: 1px dashed #d1fae5;
    min-width: 0;
}
.blv-diary-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }
.blv-diary-form .row > * { min-width: 0; }
.blv-diary-form input, .blv-diary-form select, .blv-diary-form textarea {
    padding: 8px 10px; border: 1px solid #d1fae5; border-radius: 9px;
    font-size: 13px; font-family: inherit; background: #fff;
    width: 100%; max-width: 100%; box-sizing: border-box;
}
.blv-diary-form textarea { min-height: 56px; resize: vertical; }

/* Input file estilizado (compacto y dentro del card) */
.blv-diary-foto-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #ecfdf5;
    border: 1px dashed #a7f3d0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 12px;
    color: #14532d;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
}
.blv-diary-foto-wrap:hover { background: #d1fae5; border-color: #6ee7b7; }
.blv-diary-foto-wrap input[type=file] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; padding: 0; border: none; width: 100%;
}
.blv-diary-foto-wrap .blv-foto-ic { font-size: 16px; flex-shrink: 0; }
.blv-diary-foto-wrap .blv-foto-txt {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.blv-check-water {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    background: #ecfdf5; padding: 8px 10px; border-radius: 9px;
    font-weight: 700; color: #14532d; font-size: 13px;
    border: 1px solid #a7f3d0;
    min-width: 0;
}
.blv-check-water input { accent-color: #16a34a; transform: scale(1.2); flex-shrink: 0; }
.blv-check-water span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blv-diary-status {
    display: inline-block; padding: 3px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.blv-diary-status.hoy   { background:#dcfce7; color:#166534; }
.blv-diary-status.no    { background:#fef3c7; color:#92400e; }

/* ========== Especie ver ========== */
.blv-detail-grid {
    display: grid; grid-template-columns: 320px 1fr; gap: 20px;
}
.blv-detail-photo {
    width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px;
    background: #d1fae5; border: 1px solid #a7f3d0;
}
.blv-detail-info { display: grid; gap: 14px; align-content: start; }
.blv-info-row {
    display: grid; grid-template-columns: 140px 1fr; gap: 10px;
    padding: 8px 0; border-bottom: 1px dashed #d1fae5; font-size: 14.5px;
}
.blv-info-row strong { color: #14532d; font-weight: 700; }

/* ========== Empty state ========== */
.blv-empty {
    text-align: center; padding: 40px 20px;
    color: #b6e0d0;
}
.blv-empty .ic {
    width: 80px; height: 80px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: grid; place-items: center; margin: 0 auto 16px;
    color: #4ade80;
}
.blv-empty h3 { color: #fff; margin: 0 0 6px; }
.blv-empty p { color: #b6e0d0; margin: 0 0 16px; }

/* ========== Compatibilidad / aliases ========== */
:root {
    --blv-bg-card: rgba(255,255,255,0.96);
    --blv-text-soft: #5b7a73;
    --blv-shadow-lg: 0 20px 50px rgba(4, 16, 10, 0.32);
}

.blv-main {
    max-width: 1280px;
    margin: 22px auto 60px;
    padding: 0 22px;
    color: var(--blv-text);
}

.blv-page-head {
    display: flex; gap: 16px; align-items: flex-start;
    justify-content: space-between; flex-wrap: wrap;
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--blv-border);
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 18px;
    box-shadow: var(--blv-shadow-soft);
}
.blv-page-head h2 { margin: 0 0 4px; color: var(--blv-text); font-size: 22px; }
.blv-page-head p { margin: 0; color: var(--blv-text-soft); font-size: 14px; }

.blv-card { background: var(--blv-bg-card); }
.blv-card { color: var(--blv-text); }

.blv-input,
.blv-page-head select,
.blv-page-head input[type="date"],
.blv-page-head input[type="text"] {
    padding: 9px 12px;
    border: 1px solid var(--blv-border);
    border-radius: 10px;
    font: inherit;
    background: #fff;
    color: var(--blv-text);
}

.blv-flash {
    padding: 12px 14px; border-radius: 10px;
    border: 1px solid;
    font-size: 14px; font-weight: 500;
}
.blv-flash-ok    { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.blv-flash-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.blv-flash-warn  { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.blv-flash-info  { background: #ecfeff; color: #155e75; border-color: #a5f3fc; }

/* ========== Responsive ========== */
@media (max-width: 960px) {
    .blv-split { grid-template-columns: 1fr; }
    .blv-detail-grid { grid-template-columns: 1fr; }
    .blv-page-head { flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) {
    .blv-landing { padding: 22px 14px 40px; gap: 22px; }
    .blv-glass, .blv-card { padding: 18px; border-radius: 18px; }
    .blv-card-info .blv-logos img { height: 70px; }
    .blv-topbar { padding: 12px 14px; gap: 10px; }
    .blv-topbar-brand img { height: 42px; }
    .blv-topbar-brand h1 { font-size: 15px; }
    .blv-info-row { grid-template-columns: 1fr; gap: 2px; }
    .blv-diary-form .row { grid-template-columns: 1fr; }
}
