:root {
  --marca: #0d2a78;          /* azul real del escudo */
  --marca-hover: #0a2160;
  --marca-oscuro: #0a1a4a;   /* azul noche (menú lateral) */
  --marca-2: #1d4fb8;
  --oro: #c9962b;
  --oro-claro: #e8c25a;
  --oro-oscuro: #8a6418;     /* dorado legible sobre fondo claro */
  --perla: #eef2fb;
}

body { font-family: 'Source Sans Pro', -apple-system, Segoe UI, Roboto, sans-serif; }
a { color: var(--marca); }
a:hover { color: var(--marca-hover); }
.text-oro { color: var(--oro) !important; }
.content-wrapper { background: #f3f5fa; }

/* Botones */
.btn-marca { color: #fff; background-color: var(--marca); border-color: var(--marca); }
.btn-marca:hover, .btn-marca:focus { color: #fff; background-color: var(--marca-hover); border-color: var(--marca-hover); }
.btn-marca:focus { box-shadow: 0 0 0 .2rem rgba(201,150,43,.45); }
.btn-marca:active { background-color: var(--marca-oscuro) !important; border-color: var(--marca-oscuro) !important; }
.btn-marca.fab { border: 2px solid var(--oro); }

/* Tarjetas */
.card-outline.card-marca { border-top: 3px solid var(--oro); }
.card-title { color: var(--marca-oscuro); font-weight: 600; }
.badge-oro { background: var(--oro); color: var(--marca-oscuro); }
.form-control:focus, .custom-select:focus { border-color: var(--oro); box-shadow: 0 0 0 .2rem rgba(201,150,43,.2); }
.custom-control-input:checked ~ .custom-control-label::before { background-color: var(--marca); border-color: var(--marca); }
.btn-group-toggle .btn-outline-secondary.active { background: var(--marca); border-color: var(--marca); color: #fff; }

/* Barra superior */
.main-header.navbar { border-bottom: 2px solid var(--oro); }

/* Menú lateral azul noche con detalles dorados */
.sidebar-marca { background: var(--marca-oscuro); }
.sidebar-marca .brand-link { background: #071338 !important; border-bottom: 1px solid rgba(232,194,90,.35) !important; }
.sidebar-marca .brand-link .brand-text { color: var(--oro-claro); letter-spacing: .02em; }
.sidebar-marca .brand-link .brand-image { box-shadow: 0 0 0 2px rgba(232,194,90,.6); }
.sidebar-marca .nav-header { color: rgba(232,194,90,.75) !important; font-size: .75rem; letter-spacing: .08em; }
.sidebar-marca .nav-sidebar > .nav-item > .nav-link { color: #d9e0f2; }
.sidebar-marca .nav-sidebar > .nav-item > .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-marca .nav-sidebar > .nav-item > .nav-link.active { background: var(--oro); color: var(--marca-oscuro); font-weight: 600; box-shadow: none; }
.sidebar-marca .nav-sidebar > .nav-item > .nav-link.active .nav-icon { color: var(--marca-oscuro); }

/* Cajas del inicio */
.small-box.bg-marca { background: var(--marca) !important; color: #fff !important; }
.small-box.bg-marca2 { background: var(--marca-2) !important; color: #fff !important; }
.small-box.bg-oro { background: linear-gradient(135deg, var(--oro-claro), var(--oro)) !important; color: var(--marca-oscuro) !important; }
.small-box.bg-perla { background: #fff !important; color: var(--marca) !important; border: 1px solid #d8def0; }
.small-box .icon > i { color: rgba(0,0,0,.15); }
.small-box.bg-marca .icon, .small-box.bg-marca2 .icon, .small-box.bg-marca .icon > i, .small-box.bg-marca2 .icon > i { color: rgba(232,194,90,.45); }
.small-box h3 { font-weight: 700; }

/* Login */
.login-marca { background: radial-gradient(ellipse at top, #16348f 0%, var(--marca-oscuro) 55%, #060f2e 100%); }
.login-marca .login-box { width: 380px; max-width: calc(100% - 32px); }
.login-marca .card { border-top: 3px solid var(--oro); border-radius: .5rem; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.login-marca h1 { color: #fff; }
.login-sub { color: var(--oro-claro); font-size: .8rem; letter-spacing: .25em; text-transform: uppercase; margin-top: .25rem; }
/* Contorno blanco difuminado para que el logo sobresalga del fondo azul */
.login-logo-img { width: 230px; max-width: 70vw; height: auto; display: inline-block;
  filter: drop-shadow(0 0 2px rgba(255,255,255,1)) drop-shadow(0 0 10px rgba(255,255,255,.7)) drop-shadow(0 0 22px rgba(255,255,255,.35)) drop-shadow(0 6px 16px rgba(0,0,0,.4)); }
@media (max-height: 640px) { .login-logo-img { width: 160px; } }

/* Galería: marca de foto principal */
.galeria .g-item .g-principal { box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* Tarjetas de perros en el listado */
.perro-card { transition: box-shadow .15s; height: 100%; }
.perro-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.perro-card a { color: inherit; text-decoration: none; }
.perro-foto { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #e9ecef; border-radius: .25rem .25rem 0 0; display: block; }
.perro-card .card-body { padding: .6rem .75rem; }
.perro-card .nombre { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.perro-card .meta { font-size: .85rem; color: #6c757d; }

/* Ficha */
.ficha-foto { width: 100%; max-width: 320px; aspect-ratio: 1 / 1; object-fit: cover; border-radius: .5rem; background: #e9ecef; }
.ficha-datos th { width: 45%; color: #6c757d; font-weight: 600; }
.ficha-datos td, .ficha-datos th { padding: .4rem .5rem; vertical-align: middle; }
.padre-box { background: #f4f6f9; border-radius: .5rem; padding: .6rem .75rem; height: 100%; }
.padre-box img { width: 48px; height: 48px; object-fit: cover; border-radius: 50%; }

/* Galería */
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.galeria .g-item { position: relative; }
.galeria .g-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: .4rem; cursor: zoom-in; display: block; }
.galeria .g-item .g-principal { position: absolute; top: 4px; left: 4px; }
.galeria .g-item .g-acciones { position: absolute; bottom: 4px; right: 4px; display: flex; gap: 4px; }
.galeria .g-item .g-acciones .btn { padding: .15rem .4rem; font-size: .75rem; }
.galeria .g-subir { border: 2px dashed #adb5bd; border-radius: .4rem; aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #6c757d; cursor: pointer; font-size: .85rem; text-align: center; }
.galeria .g-subir:hover { border-color: var(--oro-oscuro); color: var(--oro-oscuro); }

/* Vista previa de foto en formulario */
.preview-foto { width: 160px; height: 160px; object-fit: cover; border-radius: .5rem; background: #e9ecef; }

/* Alertas de sanidad */
.alerta-vencida { border-left: 4px solid #dc3545; }
.alerta-proxima { border-left: 4px solid #ffc107; }

/* Botón flotante en celulares */
.fab { position: fixed; right: 18px; bottom: 22px; width: 56px; height: 56px; border-radius: 50%; z-index: 1040; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
@media (min-width: 768px) { .fab { display: none; } }

@media (max-width: 575.98px) {
  .content-wrapper > .content { padding: 0 .4rem; }
  .card-body { padding: .9rem; }
  .ficha-foto { max-width: 100%; }
  h1, .h1 { font-size: 1.6rem; }
}
