:root { --app: #157a24; }
body { background: #f3f4f6; padding-bottom: env(safe-area-inset-bottom); }
.app-bar { background: var(--app); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.app-bar .navbar-brand { font-weight: 700; max-width: 75vw; }
.app-logo { height: 46px; width: auto; max-width: 170px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }

/* Barra arriba + menú lateral verde que se abre con las tres líneas */
.app-bar { height: 60px; }
.app-shell { min-height: calc(100vh - 60px); }
.app-main { min-width: 0; }
.app-side { --bs-offcanvas-width: 280px; background: var(--app); color: #fff; }
.app-side-head { background: rgba(0,0,0,.12); color: #fff; }
.side-logo { max-height: 60px; max-width: 200px; background: #fff; border-radius: 8px; padding: 3px; }
.side-nav { padding: .5rem 0; }
.side-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.65); padding: 1rem 1.25rem .35rem; }
.side-link { display: flex; align-items: center; gap: .8rem; padding: .75rem 1.25rem; color: rgba(255,255,255,.92); text-decoration: none;
  border-left: 4px solid transparent; font-size: 1rem; }
.side-link i { font-size: 1.25rem; width: 1.4rem; text-align: center; }
.side-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.side-link.active { background: rgba(255,255,255,.2); color: #fff; border-left-color: #fff; font-weight: 600; }
.side-foot { border-top: 1px solid rgba(255,255,255,.2); padding: .75rem 1.25rem; color: rgba(255,255,255,.8); }
.side-foot .side-link { border: 0; color: #fff !important; }
@media (max-width: 991.98px) { .app-main { padding-bottom: 80px; } }

.btn-app { background: var(--app); border-color: var(--app); color: #fff; }
.btn-app:hover, .btn-app:focus { background: var(--app); color: #fff; filter: brightness(.9); }
.text-app { color: var(--app) !important; }

/* Barra inferior (celular) */
.app-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; background: #fff;
  border-top: 1px solid #ddd; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 8px rgba(0,0,0,.06); }
.app-tabbar a { flex: 1; text-align: center; color: #666; text-decoration: none; padding: 6px 0 4px; font-size: .72rem; }
.app-tabbar a i { display: block; font-size: 1.35rem; line-height: 1.2; }
.app-tabbar a.on { color: var(--app); font-weight: 600; }
.app-tabbar a.tab-main i { background: var(--app); color: #fff; width: 46px; height: 46px; line-height: 46px; border-radius: 50%;
  margin: -20px auto 0; box-shadow: 0 3px 8px rgba(0,0,0,.25); font-size: 1.6rem; }

/* Tarjetas del inicio: grandes y ocupando la pantalla */
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center;
  background: #fff; border-radius: 18px; padding: 1.5rem .75rem; text-decoration: none; color: #222; height: 100%;
  box-shadow: 0 2px 6px rgba(0,0,0,.08); min-height: clamp(150px, 24vh, 260px); transition: transform .1s, box-shadow .1s;
  border-bottom: 5px solid var(--app); }
.tile:hover { box-shadow: 0 6px 16px rgba(0,0,0,.12); transform: translateY(-2px); color: #222; }
.tile:active { transform: scale(.97); }
.tile i { font-size: clamp(2.8rem, 6vw, 4.5rem); color: var(--app); line-height: 1; }
.tile span { font-weight: 700; font-size: clamp(1.05rem, 1.8vw, 1.45rem); }
.tile small { color: #777; font-size: clamp(.8rem, 1.1vw, 1rem); }
.stat { background: #fff; border-radius: 14px; padding: 1rem 1.25rem; box-shadow: 0 2px 6px rgba(0,0,0,.08); height: 100%;
  display: flex; align-items: center; gap: 1rem; }
.stat > i { font-size: 2.2rem; color: var(--app); opacity: .85; }
.stat .n { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; line-height: 1.1; }
.inicio-logo { max-height: 90px; max-width: 100%; }
.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); border-radius: 12px; }

/* Listado */
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #e9ecef; display: flex; align-items: center; justify-content: center; color: #aaa; flex: none; }
.rep-row { background: #fff; border-radius: 10px; padding: .55rem .7rem; margin-bottom: .45rem; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.rep-row a.stretched { color: inherit; text-decoration: none; }
.rep-id { font-family: ui-monospace, Menlo, Consolas, monospace; color: #888; font-size: .85rem; }
.ubi-chip { background: #eef2ff; color: #3730a3; border-radius: 6px; padding: 1px 7px; font-size: .8rem; white-space: nowrap; }
.ubi-chip.vacia { background: #fff4e5; color: #b45309; }

/* Fotos */
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.galeria .ft { position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; background: #ddd; }
.galeria .ft img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.galeria .ft .del { position: absolute; top: 4px; right: 4px; border: 0; background: rgba(0,0,0,.6); color: #fff; width: 30px; height: 30px; border-radius: 50%; }
.galeria .ft.subiendo::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.6) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><circle cx="25" cy="25" r="18" fill="none" stroke="%23333" stroke-width="5" stroke-dasharray="80 40"><animateTransform attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.8s" repeatCount="indefinite"/></circle></svg>') center/40px no-repeat; }
.foto-btns .btn { padding: .8rem; font-size: 1.05rem; }
#visor .modal-content { background: #000; }
#visor img { max-height: 85vh; object-fit: contain; }

/* Escáner */
#lector { width: 100%; max-width: 520px; margin: 0 auto; border-radius: 14px; overflow: hidden; background: #000; min-height: 240px; }
#lector video { border-radius: 14px; }
.scan-paso { font-size: 1.15rem; font-weight: 600; }
.scan-log li { padding: .35rem 0; border-bottom: 1px dashed #ddd; }

.form-label { font-weight: 600; margin-bottom: .2rem; }
.form-control, .form-select { padding: .6rem .75rem; }
.sticky-actions { position: sticky; bottom: 70px; z-index: 5; }
@media (min-width: 992px) { .sticky-actions { bottom: 10px; } }

.nav-pills .nav-link { color: #444; }
.nav-pills .nav-link.active { background: var(--app); color: #fff; }
.scan-tabs .nav-link { padding: .5rem .25rem; font-size: .9rem; line-height: 1.15; }
.scan-tabs .nav-link i { display: block; font-size: 1.2rem; }
@media (min-width: 576px) { .scan-tabs .nav-link i { display: inline; } }

.app-cont { max-width: 1800px; padding-left: clamp(12px, 2.5vw, 40px); padding-right: clamp(12px, 2.5vw, 40px); }
