/* static/css/styles.css (GLOBAL) */

:root{
  --bg:#f3f6f4;
  --txt:#1e2a36;
  --muted:#5d6a74;
  --green:#2f7d60;
  --green-2:#3d8f6f;
  --wheat:#b87939;
  --card:#ffffffd9;
  --line:#dfe7e2;
  --shadow:0 10px 24px rgba(30,42,54,.08);
  --maxw:1280px;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color:var(--txt);
  background:var(--bg);
  position: relative;
}

.page{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 20px 0;
}

.reportes-page .page{
  max-width: none;
  margin: 0;
  padding: 18px 28px 0;
}

/* Background helpers */
.app-bg,
.reportes-page{
  background: linear-gradient(180deg, #edf4ef, #f5f8f5);
}

.app-bg::before,
.reportes-page::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(248,250,248,.78), rgba(248,250,248,.78)),
    url("/static/img/fondo-campo.png") center top / cover no-repeat;
  transform: translateZ(0);
}

/* Topbar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.topbar-inner{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display:flex;
  align-items:center;
  gap: 14px;
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  text-decoration: none;
  color: var(--txt);
  letter-spacing: .2px;
}

.brand-mark{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: #214f3b;
  background: linear-gradient(145deg, rgba(233,242,236,0.96), rgba(214,231,221,0.9));
  border: 1px solid rgba(47,125,96,0.14);
  box-shadow: 0 8px 18px rgba(31, 64, 49, 0.08);
}

.brand-mark svg{
  width: 26px;
  height: 26px;
}

.brand-text{
  display: inline-block;
}

.nav{
  display:flex;
  gap: 10px;
  margin-left: 8px;
}

.nav-link{
  text-decoration:none;
  color: var(--txt);
  padding: 8px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.nav-link:hover{ background: rgba(0,0,0,.06); }

.header-actions{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap: 10px;
}

.user{
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  font-size: 14px;
}

/* Reusables */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  font-weight: 800;
  text-decoration:none;
  border: 1px solid transparent;
}

.btn-outline{
  background: rgba(255,255,255,.72);
  color: var(--txt);
  border-color: rgba(0,0,0,.12);
}

.btn-solid{
  background: var(--green);
  color: #fff;
}

.lang{
  display:flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(0,0,0,.10);
}

.lang-select{
  border:none;
  background: transparent;
  font-weight: 800;
  outline: none;
  cursor: pointer;
}

.site-footer{
  margin-top: 0;
  border-top: 1px solid rgba(37, 92, 69, 0.14);
  background:
    linear-gradient(180deg, rgba(222,239,230,.94), rgba(205,229,216,.98));
  backdrop-filter: blur(10px);
}

.site-footer-inner{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 20px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.site-footer-brand{
  display: grid;
  gap: 10px;
}

.site-footer-logo{
  text-decoration: none;
  color: #1b3329;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.site-footer-brand p{
  margin: 0;
  max-width: 680px;
  color: #586975;
  line-height: 1.65;
}

.site-footer-links{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.site-footer-column{
  display: grid;
  gap: 10px;
}

.site-footer-title{
  color: #7a6842;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.site-footer-column a,
.site-footer-column span{
  color: #30443a;
  text-decoration: none;
  line-height: 1.5;
}

.site-footer-legal-links{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-footer-column a:hover{
  color: var(--green);
}

.site-footer-bottom{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 20px 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #667782;
  font-size: 13px;
  border-top: 1px solid rgba(37, 92, 69, 0.1);
}

@media (max-width: 900px){
  .site-footer-inner{
    grid-template-columns: 1fr;
  }

  .site-footer-links{
    grid-template-columns: 1fr;
  }

  .site-footer-bottom{
    flex-direction: column;
  }
}

@media (max-width: 980px){
  .topbar{
    position: static;
  }

  .topbar-inner{
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .brand{
    flex: 1 1 auto;
    min-width: 0;
  }

  .nav{
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .nav-link{
    flex: 0 0 auto;
    padding: 8px 12px;
    background: rgba(255,255,255,.5);
    border: 1px solid rgba(0,0,0,.06);
  }

  .header-actions{
    margin-left: auto;
    flex: 0 0 auto;
  }
}

@media (max-width: 640px){
  .reportes-page .page{
    padding: 16px 14px 0;
  }
  .page{
    padding: 14px 14px 0;
  }

  .brand-text{
    font-size: 24px;
  }

  .header-actions{
    width: 100%;
    justify-content: space-between;
  }

  .user{
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn{
    height: 38px;
    padding: 0 12px;
  }
}
