:root{
    --brand: #859C4C;       /* color principal */
    --brand-dark: #6c8040;  /* variante oscura para hover */
    --brand-light: #BDDBBB; /* color secundario / contrastes */
    --on-dark: #ffffff;     /* texto sobre fondo oscuro */
    --on-light: #859C4C;    /* texto de marca sobre fondo claro */
    --glass-bg: rgba(255,255,255,.55);
    --glass-border: rgba(255,255,255,.6);
    --shadow-soft: 0 8px 30px rgba(60,80,40,.10);
    --shadow-lift: 0 14px 34px rgba(60,80,40,.18);
    --ease: cubic-bezier(.22,1,.36,1);
}

*{ box-sizing:border-box; }

body{
    background:
        radial-gradient(circle at 10% 0%, rgba(133,156,76,.14), transparent 45%),
        radial-gradient(circle at 90% 10%, rgba(189,219,187,.30), transparent 45%),
        #f3f6ee;
    font-family:'Roboto', Arial, sans-serif;
    color:#2b2f26;
    animation: fadeIn .5s var(--ease);
}
h1,h2,h3,h4,h5,h6{ font-family:'Roboto', Arial, sans-serif; }

@keyframes fadeIn{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }
@keyframes floatIn{ from{ opacity:0; transform:translateY(14px) scale(.98); } to{ opacity:1; transform:none; } }

/* Encabezados y textos de marca sobre fondo claro usan el color principal */
h3.fw-bold, .card-title{ color: var(--on-light); }

#wrapper{ min-height:100vh; }

/* ---------- Sidebar (glass sobre degradado de marca) ---------- */
.sidebar{
    width:260px; min-width:260px; color:var(--on-dark);
    background: linear-gradient(165deg, var(--brand), var(--brand-dark));
    display:flex; flex-direction:column; position:sticky; top:0; height:100vh;
    border-radius: 0 28px 28px 0;
    box-shadow: 14px 0 40px rgba(30,40,15,.30), 4px 0 12px rgba(30,40,15,.18);
    transition: left .3s var(--ease);
}
.sidebar-brand{
    padding:22px 18px; border-bottom:1px solid rgba(255,255,255,.18);
    display:flex; align-items:center; justify-content:center;
}
.sidebar-brand img{ max-width:100%; height:auto; max-height:46px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.15)); }

.sidebar .nav-link, .sidebar-user-btn{
    background: linear-gradient(135deg, #ffffff, #eef3e6);
    color: var(--brand-dark);
    border: 1px solid rgba(255,255,255,.6);
    padding:12px 18px; margin:6px 12px; border-radius:999px;
    box-shadow: 0 6px 16px rgba(0,0,0,.18);
    transition: box-shadow .3s var(--ease), transform .2s var(--ease), background .3s var(--ease);
}
.sidebar .nav-link i, .sidebar-user-btn i{ margin-right:8px; color: inherit; }
.sidebar .nav-link:hover, .sidebar .nav-link:focus,
.sidebar-user-btn:hover, .sidebar-user-btn:focus{
    background: linear-gradient(135deg, #ffffff, var(--brand-light));
    color: var(--brand-dark);
    box-shadow: 0 10px 22px rgba(0,0,0,.24);
    transform: translateY(-2px);
}
.sidebar .nav-link.active{
    background: linear-gradient(135deg, #ffffff, var(--brand-light));
    box-shadow: 0 10px 22px rgba(0,0,0,.24);
}
.sidebar-footer{ margin-top:auto; padding:16px 18px; border-top:1px solid rgba(255,255,255,.18); }
.sidebar-user-btn{
    display:flex; align-items:center; text-decoration:none; width:100%; margin:6px 0 10px;
}
.sidebar-user-btn img{ box-shadow:0 2px 8px rgba(0,0,0,.15); }
.sidebar-footer .btn-outline-light{
    border-radius:999px; border-color:rgba(255,255,255,.6);
    transition: all .25s var(--ease);
}
.sidebar-footer .btn-outline-light:hover{ background:#fff; color:var(--brand-dark); transform: translateY(-2px); }

.content-area{ min-width:0; }

/* ---------- Glass cards ---------- */
.card, .card-stat{
    border:1px solid var(--glass-border);
    border-radius:20px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
    animation: floatIn .45s var(--ease);
}
.card:hover, .card-stat:hover{
    transform: translateY(-3px);
    box-shadow: var(--shadow-lift);
}

/* ---------- Botones estilo "glass" ---------- */
.btn{
    border-radius: 999px !important;
    transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), filter .25s var(--ease);
    font-weight:500;
}
.btn:active{ transform: scale(.96); }

.btn-brand{
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: var(--on-dark);
    border: 1px solid rgba(255,255,255,.35);
    box-shadow: 0 8px 20px rgba(133,156,76,.35);
    backdrop-filter: blur(6px);
}
.btn-brand:hover{
    color: var(--on-dark);
    box-shadow: 0 12px 26px rgba(133,156,76,.5);
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn-outline-secondary{
    color:var(--on-light); border:1px solid var(--brand-light);
    background: rgba(189,219,187,.18);
    backdrop-filter: blur(6px);
}
.btn-outline-secondary:hover{
    background: var(--brand-light); border-color:var(--brand-light); color:var(--on-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(189,219,187,.5);
}

.btn-outline-danger, .btn-outline-success{ backdrop-filter: blur(6px); }
.btn-outline-danger:hover, .btn-outline-success:hover{ transform: translateY(-2px); }

/* ---------- Enlaces ---------- */
a{ color:var(--on-light); transition: color .2s var(--ease); }
a:hover{ color:var(--brand-dark); }

/* ---------- Badges tipo píldora ---------- */
.badge{ border-radius:999px !important; padding:.45em .9em; font-weight:500; box-shadow:0 2px 8px rgba(0,0,0,.08); }
.badge.bg-primary{ background:linear-gradient(135deg,var(--brand),var(--brand-dark)) !important; color:var(--on-dark) !important; }
.badge.bg-secondary{ background:var(--brand-light) !important; color:var(--on-light) !important; }

/* ---------- Formularios ---------- */
.form-control, .form-select{
    border-radius:14px; border:1px solid rgba(133,156,76,.25);
    background: rgba(255,255,255,.7);
    transition: box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.form-control:focus, .form-select:focus{
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(133,156,76,.18);
}

/* ---------- Tablas ---------- */
.table{ border-radius:14px; overflow:hidden; }
.table thead th{ border-bottom:2px solid var(--brand-light); color:var(--on-light); font-weight:600; }
.table tbody tr{ transition: background .2s var(--ease); }
.table tbody tr:hover{ background: rgba(189,219,187,.22); }

.nav-tabs .nav-link{ border-radius:14px 14px 0 0; transition: all .2s var(--ease); }
.nav-tabs .nav-link.active{ color:var(--on-light); border-bottom:3px solid var(--brand); }

/* ---------- Login ---------- */
.login-wrapper{
    min-height:100vh; display:flex; align-items:center; justify-content:center;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 55%, #4f5f30 100%);
    background-size: 200% 200%;
    animation: gradientShift 12s ease infinite;
    position:relative; overflow:hidden;
}
@keyframes gradientShift{
    0%{ background-position:0% 50%; }
    50%{ background-position:100% 50%; }
    100%{ background-position:0% 50%; }
}
.login-card{
    max-width:400px; width:100%; text-align:center;
    border-radius:24px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border:1px solid rgba(255,255,255,.6);
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
    animation: floatIn .5s var(--ease);
}
.login-card img{ max-width:220px; height:auto; margin-bottom:8px; }

.navbar.bg-white{
    background: rgba(255,255,255,.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.navbar-brand-logo{ height:32px; width:auto; }

.alert{ border-radius:16px; border:none; box-shadow: var(--shadow-soft); }

@media (max-width: 991px){
    .sidebar{ position:fixed; left:-270px; z-index:1050; }
    .sidebar.show{ left:0; }
}
