:root{
  --bg:#f6f4ef;
  --surface:#ffffff;
  --surface2:#fbfaf7;
  --text:#171717;
  --muted:#5d616b;
  --line:#e6e1d6;
  --shadow: 0 10px 30px rgba(0,0,0,.08);

  --primary:#1f7a3f;
  --primary-2:#f28c28;
  --primary-ink:#ffffff;

  --focus: rgba(31,122,63,.25);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background: radial-gradient(1200px 700px at 20% -10%, rgba(242,140,40,.18), transparent 60%),
              radial-gradient(1100px 650px at 90% 0%, rgba(31,122,63,.14), transparent 55%),
              var(--bg);
  color: var(--text);
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

.container{ width:min(1000px, calc(100% - 24px)); margin:24px auto; }

/* ---------------- TOPBAR ---------------- */
.topbar{
  position: sticky;
  top: 0;
  background: rgba(246,244,239,.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  z-index: 50;
}

.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 14px;
  width:min(1000px, calc(100% - 24px));
  margin: 0 auto;

  min-height: 76px;
}

/* BRAND (texto) */
.brand{
  font-weight: 800;
  letter-spacing: .2px;
  display:flex;
  align-items:center;
  gap:10px;
}
.brand__dot{
  width:10px; height:10px; border-radius:999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 0 4px rgba(31,122,63,.10);
}

/* BRAND (logo) */
.brand--link{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none !important;

  height: 56px;
  overflow: visible;
}

.brand__logo{
  display:block;
  height: 80px;
  width: auto;
  max-width: 340px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.10));

  transform: scale(1.50);
  transform-origin: left center;
}

/* Nav */
.topbar__nav a{
  margin-left: 14px;
  color: var(--muted);
  font-weight: 600;
}
.topbar__nav a:hover{ color: var(--text); text-decoration:none; }

/* ---------------- TIPOGRAFÍA ---------------- */
h1{ font-size: 38px; margin: 0 0 10px; letter-spacing:-.6px; }
h2{ font-size: 20px; margin: 18px 0 8px; letter-spacing:-.2px; }
p{ line-height: 1.55; }
.muted{ color: var(--muted); }

/* ---------------- HERO ---------------- */
.hero{
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.78));
  box-shadow: var(--shadow);
}
.notice{
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(31,122,63,.35);
  background: rgba(31,122,63,.06);
  color: var(--muted);
}
.notice strong{ color: var(--text); }

.searchrow{ display:flex; gap:10px; margin-top: 14px; }
@media (max-width: 520px){ .searchrow{ flex-direction:column; } }

/* ---------------- FORM CONTROLS ---------------- */
input, textarea{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  color: var(--text);
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease, transform .05s ease;
}
input:focus, textarea:focus{
  border-color: rgba(31,122,63,.55);
  box-shadow: 0 0 0 5px var(--focus);
}
textarea{ resize: vertical; min-height: 86px; }

label{
  display:block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

/* ---------------- BUTTONS ---------------- */
button{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(31,122,63,.25);
  background: linear-gradient(135deg, var(--primary), #145d2f);
  color: var(--primary-ink);
  cursor:pointer;
  font-weight: 800;
  letter-spacing: .2px;
  box-shadow: 0 10px 22px rgba(31,122,63,.20);
  transition: transform .06s ease, filter .12s ease, box-shadow .12s ease;
}
button:hover{ filter: brightness(1.05); }
button:active{ transform: translateY(1px); box-shadow: 0 8px 18px rgba(31,122,63,.18); }

.btn-secondary{
  border-color: rgba(0,0,0,.08);
  background: linear-gradient(135deg, #ffffff, #f2efe7);
  color: var(--text);
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}
.btn-secondary:hover{ filter: brightness(1.02); }

.alert{
  padding: 12px 14px;
  border: 1px solid rgba(200,55,55,.25);
  background: rgba(200,55,55,.08);
  border-radius: 14px;
  margin: 12px 0;
  color: var(--text);
}

/* ---------- QUICK ACTIONS ---------- */
.quick{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 820px){ .quick{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px){ .quick{ grid-template-columns: 1fr; } }

.quick__item{
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.86));
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  display:flex;
  align-items:center;
  gap: 12px;
  text-decoration:none !important;
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;

  height: 92px;
  overflow: hidden;
}
.quick__item:hover{
  transform: translateY(-1px);
  border-color: rgba(31,122,63,.25);
  box-shadow: 0 12px 26px rgba(0,0,0,.08);
}
.quick__item img{
  width: 74px;
  height: 74px;
  object-fit: contain;
  border-radius: 14px;
  flex: 0 0 74px;

  transform: scale(1.55);
  transform-origin: center;
}
.quick__item span{
  font-weight: 900;
  letter-spacing: -.2px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Móvil */
@media (max-width: 520px){
  .topbar__inner{ min-height: 72px; }
  .brand--link{ height: 50px; }

  .brand__logo{
    height: 50px;
    max-width: 300px;
    transform: scale(2.50);
  }

  .quick__item{ height: 98px; }
  .quick__item img{
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    transform: scale(1.60);
  }
  .quick__item span{ font-size: 20px; }
}

/* ---------- LIST CARDS ---------- */
.cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 820px){ .cards{ grid-template-columns: repeat(2, 1fr);} }
@media (max-width: 520px){ .cards{ grid-template-columns: 1fr;} }

.card{
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.86));
  box-shadow: var(--shadow);
}

/* NUEVO: cabecera de card con icono */
.card__head{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-bottom: 10px;
}
.card__icon{
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: contain;

  /* Zoom para bordes del PNG */
  transform: scale(1.25);
  transform-origin: center;
  flex: 0 0 52px;
}
.card__headText{ min-width: 0; }

.card__title{
  font-weight: 900;
  margin-bottom: 6px;
  letter-spacing: -.2px;
}
.card__text{ color: var(--muted); }

/* NUEVO: acciones */
.card__actions{
  display:flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.card__btn{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(31,122,63,.22);
  background: linear-gradient(135deg, rgba(31,122,63,.10), rgba(242,140,40,.08));
  color: var(--text);
  font-weight: 900;
  text-decoration:none !important;
  transition: transform .06s ease, filter .12s ease;
}
.card__btn:hover{ filter: brightness(1.03); }
.card__btn:active{ transform: translateY(1px); }
.card__btnIcon{
  width: 22px;
  height: 22px;
  object-fit: contain;
  transform: scale(1.35);
  transform-origin: center;
}

/* ---------- GRID helpers ---------- */
.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
@media (max-width: 780px){ .grid{ grid-template-columns: 1fr; } }

.grid2{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 640px){ .grid2{ grid-template-columns: 1fr; } }

/* Tabla simple para pendientes */
.table{
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  margin-top: 14px;
  box-shadow: var(--shadow);
  background: var(--surface);
}
.row{
  display:grid;
  grid-template-columns: 70px 1.4fr 1fr 1fr 170px;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  align-items: center;
}
.row.head{
  background: rgba(31,122,63,.06);
  font-weight: 900;
  border-top: none;
}

/* ---------- ADMIN / LOGIN layout ---------- */
.page{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
}

.auth{
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.86));
  box-shadow: var(--shadow);
}

.auth__brand{
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom: 10px;
}
.auth__brand img{
  height: 58px;
  width: auto;
  object-fit: contain;
  transform: scale(1.35);
  transform-origin: center;
}

.auth h1{
  font-size: 28px;
  margin: 10px 0 6px;
  text-align:center;
}
.auth .muted{
  text-align:center;
  margin-top: 0;
}