/*
Archivo: public/assets/css/app.css
InfoDirectorio v0.3.1
*/
:root {
    --app-dark: #14213d;
    --app-accent: #fca311;
    --app-soft: #f8fafc;
}
body {
    background: #f3f6fb;
    color: #1f2937;
}
.app-navbar {
    background: linear-gradient(135deg, #14213d, #243b68);
    box-shadow: 0 8px 24px rgba(20,33,61,.18);
}
.app-footer {
    color: #64748b;
}
.card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 10px 28px rgba(15,23,42,.08);
}
.kpi-card {
    min-height: 120px;
}
.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #243b68;
}
.status-badge {
    border-radius: 999px;
    padding: .35rem .65rem;
    font-size: .78rem;
    font-weight: 700;
}
.status-activa { background: #dcfce7; color: #166534; }
.status-desactivada { background: #fef9c3; color: #854d0e; }
.status-cerrada { background: #fee2e2; color: #991b1b; }
.action-icon {
    border: none;
    background: transparent;
    font-size: 1.05rem;
    margin: 0 .15rem;
}
.action-icon:hover {
    transform: translateY(-1px);
}
.editable {
    cursor: text;
    border-bottom: 1px dashed transparent;
}
.editable:hover {
    border-bottom-color: #94a3b8;
    background: #f8fafc;
}
.table td, .table th {
    vertical-align: middle;
}
.icon-link {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    text-decoration: none;
    background: #eef2ff;
    color: #14213d;
}
.icon-link:hover {
    background: #dbeafe;
}
.login-shell {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #334155 0, #14213d 38%, #0f172a 100%);
}
.login-card {
    max-width: 440px;
    width: 100%;
}
.console-box {
    background: #0f172a;
    color: #d1fae5;
    border-radius: 1rem;
    padding: 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    min-height: 160px;
    max-height: 320px;
    overflow: auto;
}
@media (max-width: 768px) {
    .container-fluid { padding-left: .85rem; padding-right: .85rem; }
    .card-body { padding: 1rem; }
    .table { font-size: .9rem; }
    .action-icon { font-size: 1.25rem; }
}
.cambios-dashboard {
    border-left: 6px solid var(--app-accent) !important;
}
.audit-filters .form-control,
.audit-filters .form-select {
    min-height: 42px;
}
.audit-value-cell {
    max-width: 360px;
    white-space: normal;
    word-break: break-word;
    font-size: .86rem;
}

/* InfoDirectorio v0.3.1 - modales y contact icons */
.contact-icons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.icon-link.whatsapp {
    background: #dcfce7;
    color: #166534;
}
.icon-link.whatsapp:hover {
    background: #bbf7d0;
}
.modal-section-title {
    font-weight: 800;
    color: #14213d;
    background: #f8fafc;
    border-left: 4px solid var(--app-accent);
    padding: .65rem .85rem;
    border-radius: .75rem;
    margin-bottom: .75rem;
}
.modal-xl .form-label {
    font-weight: 700;
    color: #334155;
}
.btn .fa-solid,
.btn .fa-brands,
.icon-link .fa-solid,
.icon-link .fa-brands {
    pointer-events: none;
}
@media (max-width: 768px) {
    .contact-icons .icon-link {
        width: 38px;
        height: 38px;
    }
    .modal-dialog-scrollable .modal-body {
        max-height: calc(100vh - 190px);
    }
}

/* InfoDirectorio v0.3.1 - ayudas visuales y tooltips */
.help-icon {
    color: #64748b;
    font-size: .9rem;
    cursor: help;
    margin-left: .25rem;
}
.help-icon:hover {
    color: var(--app-accent);
}
.tooltip-inner {
    max-width: 280px;
    text-align: left;
    font-size: .84rem;
}
.icon-link[data-bs-toggle="tooltip"],
.btn[data-bs-toggle="tooltip"] {
    cursor: pointer;
}


/* InfoDirectorio v0.3.1 - estado de revisión */
.revision-badge {
    border-radius: 999px;
    padding: .35rem .65rem;
    font-size: .78rem;
    font-weight: 800;
    display: inline-block;
}
.revision-revisado { background: #dcfce7; color: #166534; }
.revision-pendiente { background: #e0f2fe; color: #075985; }
.revision-dudoso { background: #ffedd5; color: #9a3412; }

/* v0.1.7 - Campos personalizados y revisión de faltantes */
#customFieldsContainer .form-label { font-weight: 600; }
.kpi-card { background:#fff; border:1px solid rgba(15,23,42,.10); border-radius:1rem; padding:1rem; box-shadow:0 10px 25px rgba(15,23,42,.05); }
.kpi-label { color:#64748b; font-size:.85rem; }
.kpi-value { font-size:2rem; font-weight:800; color:#0f172a; }

/* InfoDirectorio v0.3.1 - logo, portal empresario y fotos */
.app-header-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 10px 24px rgba(15,23,42,.18);
}
.company-photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
}
.company-photo-thumb {
    width: 104px;
    border: 1px solid rgba(15,23,42,.12);
    border-radius: .8rem;
    background: #fff;
    padding: .35rem;
    box-shadow: 0 6px 18px rgba(15,23,42,.06);
}
.company-photo-thumb img {
    width: 100%;
    height: 72px;
    object-fit: cover;
    border-radius: .55rem;
    display: block;
}
.company-photo-thumb span {
    display: block;
    font-size: .72rem;
    color: #64748b;
    margin-top: .25rem;
    text-align: center;
}

/* InfoDirectorio v0.3.1 - cambios limpios y modales de detalle */
.dashboard-changes-table td,
.dashboard-changes-table th {
    vertical-align: middle;
}
.audit-detail-list dt {
    color: #475569;
    font-weight: 800;
}
.audit-pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 230px;
    overflow: auto;
    padding: .75rem;
    border-radius: .75rem;
    background: #f8fafc;
    border: 1px solid rgba(15,23,42,.10);
    font-size: .86rem;
}
#cambiosTable .btn,
.dashboard-changes-table .btn {
    line-height: 1;
}

/* InfoDirectorio v0.2.5 */
.console-box {
    min-height: 170px;
    max-height: 300px;
    overflow: auto;
    background: #101828;
    color: #d0f6dd;
    border-radius: 14px;
    padding: 14px;
    font-size: 13px;
    white-space: pre-wrap;
}

.custom-field-group-title{
  font-size:.86rem;
  font-weight:700;
  color:#374151;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:.75rem;
  padding:.55rem .75rem;
  margin-top:.25rem;
}


/* InfoDirectorio v0.3.1 - logo InfoPirineo y mapas */
.app-footer-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(15,23,42,.10);
}
.public-map-card {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(15,23,42,.10);
    background: #fff;
}


/* InfoDirectorio v0.8.106 - logo de app en login y pie */
.login-card {
    border: 0;
    border-radius: 1.35rem;
    overflow: hidden;
    box-shadow: 0 22px 70px rgba(2, 6, 23, .34);
}
.login-brand .login-logo-infodirectorio {
    width: 116px;
    height: 116px;
    border-radius: 28px;
    object-fit: contain;
    background: #fff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .20);
}
.login-powered-by {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    color: #64748b;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.login-powered-by img {
    width: 94px;
    height: auto;
    max-height: 32px;
    object-fit: contain;
}
.app-footer-brand-logos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    flex-shrink: 0;
}
.app-footer-logo.app-footer-logo-infodirectorio {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: contain;
    background: #fff;
}
.app-footer-logo.app-footer-logo-infopirineo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #fff;
    padding: .15rem;
}
.app-footer-logo-separator {
    color: #94a3b8;
    font-weight: 800;
    font-size: .9rem;
}
@media (max-width: 575.98px) {
    .login-brand .login-logo-infodirectorio {
        width: 96px;
        height: 96px;
        border-radius: 24px;
    }
    .app-footer-logo.app-footer-logo-infodirectorio,
    .app-footer-logo.app-footer-logo-infopirineo {
        width: 46px;
        height: 46px;
    }
}


/* InfoDirectorio v0.8.201 - reparación menú superior, paginación y capas del grid */
.app-navbar,
.navbar.app-navbar {
    position: sticky;
    top: 0;
    z-index: 2100 !important;
}
.app-navbar .dropdown-menu,
.navbar .dropdown-menu {
    z-index: 2200 !important;
}
#empresasTable_wrapper .dataTables_paginate,
#empresasTable_wrapper .dataTables_info,
#empresasTable_wrapper .dataTables_length {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
#empresasTable_wrapper > .row:last-child {
    position: relative;
    z-index: 5;
    background: #fff;
    border-top: 1px solid rgba(15,23,42,.08);
    margin-top: .65rem;
    padding-top: .75rem;
}
#empresasTable_wrapper .pagination {
    flex-wrap: wrap;
    gap: .15rem;
}
#empresasTable_wrapper .paginate_button .page-link {
    border-radius: 10px;
    margin: 0 .05rem;
}
.empresas-grid-scroll {
    overflow: visible !important;
}
#empresasTable_wrapper .dataTables_scrollBody {
    border-bottom: 1px solid rgba(15,23,42,.08);
}
.empresas-gestion-map .leaflet-container,
#empresasGestionMap.leaflet-container {
    z-index: 1;
}
.empresas-map-leaflet-pin {
    border: 3px solid #fff;
    border-radius: 999px;
    box-shadow: 0 3px 9px rgba(15,23,42,.35);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.empresas-map-leaflet-pin.is-square { border-radius: 8px; }
.empresas-map-leaflet-pin.is-pin { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.empresas-map-leaflet-pin.is-pin span { transform: rotate(45deg); }
.empresas-map-empty {
    position: absolute;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    background: rgba(248,250,252,.92);
    color: #64748b;
    font-weight: 700;
}
@media (max-width: 991.98px) {
    .app-navbar .dropdown-menu {
        position: static !important;
        transform: none !important;
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* v0.8.202: marcadores del mapa por sector con icono FontAwesome y color configurable. */
.empresas-map-sector-marker {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    border: 3px solid #fff !important;
    box-shadow: 0 5px 14px rgba(15,23,42,.38) !important;
    line-height: 1 !important;
}
.empresas-map-sector-marker i {
    color: #fff !important;
    line-height: 1 !important;
    pointer-events: none !important;
}
.empresas-map-sector-marker.is-pin i,
.empresas-native-marker.is-pin i {
    transform: rotate(45deg) !important;
}
.empresas-native-marker.empresas-map-sector-marker::after {
    display: none !important;
}
#empresasTable_processing {
    z-index: 20 !important;
    border-radius: 14px !important;
    border: 1px solid rgba(15,23,42,.12) !important;
    box-shadow: 0 12px 30px rgba(15,23,42,.12) !important;
}


/* InfoDirectorio v0.8.208 - dropdown superior de Administración dentro de pantalla */
.app-navbar {
    z-index: 1080;
}
.app-navbar .navbar-collapse {
    overflow: visible;
}
.app-navbar .dropdown-menu {
    z-index: 1090;
}
.app-admin-dropdown-menu {
    max-height: calc(100vh - 86px);
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 18rem;
    max-width: min(92vw, 24rem);
    overscroll-behavior: contain;
}
.app-admin-dropdown-menu .dropdown-item {
    white-space: normal;
    line-height: 1.25;
    padding-top: .55rem;
    padding-bottom: .55rem;
}
@media (min-width: 992px) {
    .app-admin-dropdown-menu {
        right: 0;
        left: auto;
    }
}
@media (max-width: 991.98px) {
    .app-admin-dropdown-menu {
        max-height: 65vh;
        max-width: 100%;
    }
}
