:root{
  --green:#079a43;
  --green2:#0aa64c;
  --greenDark:#006b2e;
  --orange:#ff7a1a;
  --blue:#0057ff;
  --line:#d8e1e8;
  --soft:#f5f8fa;
  --text:#00233b;
  --danger:#e74c3c;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Arial,Helvetica,sans-serif;background:var(--soft);color:var(--text);font-size:14px}
a{color:inherit}

/* ================= ADMIN GENERAL ================= */
.layout{display:flex;min-height:100vh;width:100%;overflow-x:hidden}
.sidebar{width:260px;min-width:260px;background:#fff;border-right:1px solid var(--line);position:fixed;top:0;bottom:0;left:0;overflow:auto;z-index:20}
.brand{min-height:72px;display:flex;gap:10px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--line);font-weight:900;font-size:18px;color:#087d39;line-height:1.15;letter-spacing:.2px;white-space:normal}
.brand img{width:46px!important;height:46px!important;object-fit:contain;flex:0 0 auto;max-width:46px!important;max-height:46px!important}
.menu{padding:14px 12px}
.menu a{display:block;padding:11px 12px;margin-bottom:6px;border-radius:9px;color:#007a34;text-decoration:none;font-weight:800;font-size:15px;line-height:1.2}
.menu a:hover{background:#eaf6ef;color:var(--orange)}
.main{margin-left:260px;width:calc(100% - 260px);min-height:100vh}
.topbar{height:68px;background:#fff;border-bottom:1px solid var(--line);display:grid;grid-template-columns:48px 1fr auto;align-items:center;gap:12px;padding:0 18px;position:sticky;top:0;z-index:10}
.hamb{font-size:24px;color:#07803b;font-weight:900}
.badge-title{justify-self:center;background:var(--green2);color:#fff;padding:11px 34px;border-radius:6px;font-weight:900;font-size:21px;letter-spacing:1.4px;white-space:nowrap}
.user{font-weight:900;color:#0057ff;font-size:14px;white-space:nowrap}.user a{color:#0057ff;text-decoration:none}
.content{padding:18px 20px;max-width:1600px;margin:0 auto;width:100%}
.section-title{background:var(--green2);color:#fff;border-radius:7px;padding:15px 20px;font-size:21px;font-weight:900;margin-bottom:15px;letter-spacing:.3px}
.panel{background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 2px 8px #00000012;margin-top:16px;overflow:hidden}
.panel h2{font-size:20px;margin:0;padding:16px 18px;border-bottom:1px solid var(--line);color:#00233b}
.panel-body{padding:16px 18px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px}.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}
label{font-weight:800;display:block;margin:8px 0 5px}
input,select,textarea{width:100%;padding:10px 12px;border:1px solid #ccd7df;border-radius:7px;margin:5px 0 10px;background:#fff;font-size:14px;color:#001b2e}textarea{min-height:92px;resize:vertical}
.btn{border:0;background:#e9f7ef;color:#007a34;border-radius:7px;padding:10px 16px;font-weight:900;cursor:pointer;text-decoration:none;display:inline-block;font-size:14px;line-height:1.1}
.btn.primary{background:var(--green2);color:#fff}.btn.orange{background:var(--orange);color:#fff}.btn.danger{background:#ffe9e9;color:#b00020}.btn.full{width:100%;text-align:center}
.btn:hover{filter:brightness(.95)}
.form-actions{display:flex;gap:10px;align-items:center;margin-top:12px;flex-wrap:wrap}
.btn-cancelar{background:var(--danger);color:#fff;padding:10px 16px;border-radius:7px;text-decoration:none;font-weight:900;display:inline-flex;align-items:center;justify-content:center}.btn-cancelar:hover{background:#c0392b}
table{width:100%;border-collapse:collapse;background:#fff}th,td{border:1px solid var(--line);padding:10px 12px;text-align:left;vertical-align:middle}th{background:#eaf6ef;color:#007a34;font-size:15px;font-weight:900}.table-scroll{width:100%;overflow:auto;padding-bottom:6px}.table-nowrap{min-width:850px;white-space:nowrap}.check-center{text-align:center}.check-center input{width:18px;height:18px;margin:0}.mt-16{margin-top:16px}
.sw{width:18px;height:18px;border-radius:4px;border:1px solid #3334;display:inline-block;vertical-align:middle;margin-right:6px;flex:0 0 auto}
.cards{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:14px}.card{background:#fff;border:1px solid var(--line);border-radius:9px;box-shadow:0 2px 7px #0001;padding:18px;border-left:6px solid var(--green)}.card.orange{border-left-color:var(--orange)}.card h3{margin:0 0 10px;color:#007a34;font-size:15px}.card .num{font-size:34px;font-weight:900;margin-bottom:12px}

/* Color picker cultivos */
.color-select-box{display:flex;align-items:center;gap:12px;margin:8px 0 14px;flex-wrap:wrap}.hidden-color{width:50px!important;height:42px!important;padding:0!important;border:0!important;background:none!important;cursor:pointer;margin:0!important}.color-preview{display:flex;align-items:center;gap:8px;font-weight:800}.color-swatch{width:24px;height:24px;border-radius:5px;border:1px solid #999;display:inline-block}.color-hex{font-weight:800;color:#00233b}.btn-color{background:var(--green2);color:#fff;border:0;border-radius:8px;padding:11px 16px;font-weight:900;cursor:pointer}

/* ================= LOGIN ================= */
.login-body{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% -10%, #ffffff 0 26%, transparent 27%),
    radial-gradient(circle at -8% 50%, rgba(7,154,67,.10) 0 24%, transparent 25%),
    radial-gradient(circle at 108% 50%, rgba(7,154,67,.10) 0 24%, transparent 25%),
    linear-gradient(135deg,#f6faf8 0%,#edf7f1 100%);
  padding:18px;
}

.login-shell{
  width:min(620px,92vw);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
}

.login-card{
  width:100%;
  max-width:500px;
  background:rgba(255,255,255,.97);
  border:1px solid #d6e0e6;
  border-radius:18px;
  box-shadow:0 14px 40px rgba(0,35,59,.12);
  padding:24px 30px 26px;
}

.login-brand{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  margin-bottom:14px;
}

.login-logo{
  width:68px!important;
  height:68px!important;
  object-fit:contain;
  margin-bottom:8px;
}

.login-brand h1{
  margin:0;
  color:#007f3a;
  font-size:28px;
  line-height:1;
  font-weight:900;
  letter-spacing:.5px;
}

.login-brand h2{
  margin:8px 0 3px;
  color:var(--orange);
  font-size:31px;
  line-height:1;
  font-weight:900;
  letter-spacing:3px;
  text-align:center;
}

.login-brand p{
  margin:0;
  color:#667085;
  font-size:14px;
  font-weight:700;
}

.login-form{
  margin-top:4px;
}

.login-form label{
  color:#2f3a4a;
  font-size:14px;
  font-weight:900;
  margin:12px 0 5px;
}

.login-input-wrap{
  position:relative;
  display:flex;
  align-items:center;
}

.login-icon{
  position:absolute;
  left:15px;
  top:50%;
  transform:translateY(-50%);
  color:#00823b;
  font-size:15px;
  z-index:2;
  line-height:1;
}

.login-input-wrap input{
  height:44px;
  margin:0 0 5px;
  border:1px solid #cfd9e3;
  border-radius:9px;
  background:#fff;
  box-shadow:inset 0 1px 2px rgba(0,0,0,.03);
  padding:0 14px 0 44px;
  font-size:15px;
  color:#1f2937;
}

.login-input-wrap input:focus{
  outline:none;
  border-color:#0aa64c;
  box-shadow:0 0 0 3px rgba(10,166,76,.10);
}

.password-wrap input{
  padding-right:92px!important;
  padding-left:44px!important;
}

.password-toggle{
  position:absolute;
  right:9px;
  top:50%;
  transform:translateY(-50%);
  border:0;
  background:#eaf6ef;
  color:#007f3a;
  font-weight:900;
  border-radius:8px;
  padding:7px 10px;
  cursor:pointer;
  font-size:13px;
}

.password-toggle:hover{
  background:#d9f0e3;
}

.login-submit{
  width:100%;
  height:48px;
  margin-top:14px;
  border-radius:9px;
  background:linear-gradient(135deg,#008f3d,#0bb252)!important;
  color:#fff!important;
  font-size:18px!important;
  font-weight:900!important;
  box-shadow:0 7px 16px rgba(7,154,67,.18);
}

.alert{
  background:#ffe9e9;
  color:#a4001d;
  border:1px solid #ffc8c8;
  border-radius:9px;
  padding:9px 11px;
  margin:9px 0;
  font-weight:800;
}

.hint{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  background:linear-gradient(135deg,#eaf6ef,#effaf4);
  color:#007a34;
  border-radius:9px;
  padding:10px 11px;
  margin-top:15px;
  font-size:13px;
  text-align:center;
}

.hint span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#008f3d;
  color:#fff;
  font-weight:900;
  font-size:11px;
}

.login-footer{
  color:#667085;
  font-size:12px;
  font-weight:700;
  text-align:center;
  margin-top:2px;
}

@media(max-width:720px){
  .login-body{
    padding:14px;
    overflow:auto;
  }

  .login-card{
    max-width:420px;
    padding:22px 18px;
    border-radius:16px;
  }

  .login-logo{
    width:60px!important;
    height:60px!important;
  }

  .login-brand h1{
    font-size:24px;
  }

  .login-brand h2{
    font-size:25px;
    letter-spacing:2px;
  }

  .login-brand p{
    font-size:13px;
  }

  .login-submit{
    height:46px;
    font-size:17px!important;
  }
}


/* ================= VISOR ================= */
.geo-layout{display:flex;height:100vh;width:100vw;overflow:hidden;background:#fff}.geo-sidebar{width:360px;min-width:360px;background:#fff;border-right:1px solid var(--line);height:100vh;overflow:auto;transition:.2s;z-index:1000}.geo-sidebar.hide{margin-left:-360px}.geo-brand{height:72px;display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--line)}.geo-brand img{width:46px!important;height:46px!important;object-fit:contain}.geo-brand strong{display:block;color:#007a34;font-size:22px;line-height:1;font-weight:900;letter-spacing:.5px}.geo-brand span{display:block;color:#007a34;font-size:19px;font-weight:900;letter-spacing:5px;margin-top:3px}.geo-main{flex:1;min-width:0;height:100vh;display:flex;flex-direction:column}.geo-topbar{height:72px;background:#fff;border-bottom:1px solid var(--line);display:grid;grid-template-columns:50px 1fr auto;align-items:center;gap:10px;padding:0 16px}.geo-topbar .hamb{border:0;background:transparent;color:#087d39;font-size:26px;font-weight:900;cursor:pointer}.geo-title{justify-self:center;background:var(--green2);color:#fff;border-radius:6px;padding:12px 40px;font-size:23px;font-weight:900;letter-spacing:2px;white-space:nowrap}.geo-user{color:#0057ff;font-size:14px;font-weight:900;white-space:nowrap}.geo-user a{color:#0057ff;text-decoration:none;margin-left:4px}#map{height:calc(100vh - 72px);width:100%;background:#e5e5e5}.geo-panel{margin:12px 10px;padding:13px 15px;border:1px solid #cfe5d4;border-radius:15px;background:#fff;box-shadow:0 2px 8px #0000000c}.geo-panel h3{margin:0 0 10px;color:#007a34;font-size:18px;font-weight:900}.geo-panel label{display:block;font-size:13.5px;font-weight:800;margin:8px 0 5px;color:#001b2e}.geo-panel select{width:100%;padding:9px 11px;border:1px solid #ccd7df;border-radius:8px;background:#fff;font-size:13.5px;margin-bottom:8px}.check-row{display:flex!important;align-items:center;gap:8px;font-size:14px!important;margin:8px 0!important;line-height:1.25}.check-row input{width:15px!important;height:15px!important;margin:0!important;flex:0 0 auto}.summary-box{margin-top:10px;background:#f6fbff;border:1px solid #cfe0ed;border-radius:8px;padding:9px;font-size:12.5px;overflow:auto}.summary-box h4{margin:0 0 7px;color:#00456f;font-size:14px}.summary-box table{width:100%;border-collapse:collapse}.summary-box th,.summary-box td{border:1px solid #d8e1e8;padding:5px 6px;text-align:left;font-size:12px;line-height:1.2;word-break:break-word;overflow-wrap:anywhere}.summary-box th{background:#eaf6ef;color:#007a34}.summary-box .total{font-size:14px;font-weight:900;color:#007a34;background:#eaf6ef}.legend-box{margin-top:10px}.legend-title{font-weight:900;color:#007a34;margin:8px 0;font-size:14px}.legend-item{display:flex;align-items:center;gap:8px;margin:5px 0;font-weight:700;font-size:12.5px}.leaflet-popup-content{font-size:12.5px;line-height:1.45}.popup-title{font-weight:900;color:#007a34;font-size:14px;margin-bottom:5px}.admin-return{padding:10px!important}

@media(max-width:1000px){.sidebar{width:230px;min-width:230px}.main{margin-left:230px;width:calc(100% - 230px)}.badge-title,.geo-title{font-size:18px;padding:10px 18px}.user,.geo-user{font-size:12px}.cards,.grid2,.grid3{grid-template-columns:1fr}.geo-sidebar{position:absolute;left:0;top:0}.geo-sidebar.hide{margin-left:-360px}}


/* ===== AJUSTE TABLAS RESUMEN ===== */
.summary-box table{
    width:100%;
    table-layout:fixed;
}

.summary-box td:last-child,
.summary-box th:last-child{
    text-align:right;
}

.geo-user{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
    font-weight:700;
}

.geo-user-name{
    color:#ff7f00;
}

.btn-salir{
    background:#e74c3c;
    color:#fff !important;
    padding:7px 14px;
    border-radius:8px;
    text-decoration:none;
    font-weight:800;
}

.btn-salir:hover{
    background:#c0392b;
}

.btn-volver-admin{
    background:#07833f;
    color:#fff !important;
    padding:7px 14px;
    border-radius:8px;
    text-decoration:none;
    font-weight:800;
}

.btn-volver-admin:hover{
    background:#056b34;
}
