/* ===== Base ===== */
:root {
    --muni-blue: #003fa2;
    --muni-blue-dark: #002d75;
    --muni-blue-light: #4ba6de;
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

html {
    font-size: 15px;
    position: relative;
    min-height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    margin-bottom: 60px;
    min-height: 100vh;
    background: rgba(30, 30, 30, 0.7) url(/img/fondo.jpg) center center no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-blend-mode: darken;
}

/* ===== Header ===== */
.site-header {
    background: var(--muni-blue);
    padding: 0.45rem 0;
}

.header-logo img {
    opacity: 0.95;
    transition: opacity 0.2s;
}

.header-logo img:hover {
    opacity: 1;
}

.header-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.header-link:hover {
    color: #fff;
}

/* Login partial links */
.site-header .nav-link,
.site-header .btn-link {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0;
    text-decoration: none;
}

.site-header .nav-link:hover,
.site-header .btn-link:hover {
    color: #fff !important;
}

/* ===== Main Content ===== */
.main-content {
    min-height: calc(100vh - 160px);
}

/* ===== Hero ===== */
.page-hero {
    text-align: center;
    padding: 1.5rem 0 1rem;
}

.hero-logo {
    height: 48px;
    margin-bottom: 0.5rem;
}

.page-hero h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
}

.page-hero p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin: 0;
}

/* ===== Search ===== */
.search-wrapper {
    max-width: 480px;
    margin: 0 auto 1.25rem;
    position: relative;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-wrapper .form-control {
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border-radius: 50px;
    border: 2px solid #e0e0e0;
    font-size: 0.9rem;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrapper .form-control:focus {
    border-color: var(--muni-blue-light);
    box-shadow: 0 0 0 0.2rem rgba(75, 166, 222, 0.2);
}

/* ===== Card tabla ===== */
.table-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0;
    overflow: hidden;
}

.table-card .dataTables_wrapper {
    padding: 0;
}

.table-card .table {
    margin-bottom: 0;
}

/* ===== DataTables overrides ===== */
.table-card .dataTables_wrapper .dataTables_filter,
.table-card .dataTables_wrapper .dataTables_length {
    display: none;
}

.table-card table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 0 !important;
}

.table-card table.dataTable thead th {
    background: var(--muni-blue);
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.7rem 1rem;
    border: none !important;
}

.table-card table.dataTable thead th:first-child {
    border-radius: 8px 0 0 0;
}

.table-card table.dataTable thead th:last-child {
    border-radius: 0 8px 0 0;
}

.table-card table.dataTable tbody td {
    padding: 0.6rem 1rem;
    font-size: 0.87rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.table-card table.dataTable tbody tr:hover {
    background-color: #f5f8ff !important;
}

.table-card table.dataTable tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.num-badge {
    display: inline-block;
    background: #e8f0fe;
    color: var(--muni-blue);
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.84rem;
}

.edificio-badge {
    display: inline-block;
    background: #f0f0f0;
    color: #555;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Pagination & info */
.table-card .dataTables_wrapper .dataTables_info {
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
}

.table-card .dataTables_wrapper .dataTables_paginate {
    padding: 0.75rem 1rem;
}

.table-card .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    margin: 0 2px;
    font-size: 0.82rem;
}

.table-card .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--muni-blue) !important;
    color: #fff !important;
    border-color: var(--muni-blue) !important;
}

.table-card .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e8f0fe !important;
    color: var(--muni-blue) !important;
    border-color: #e8f0fe !important;
}

/* ===== Correction banner ===== */
.correction-banner {
    text-align: center;
    padding: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
}

.correction-banner a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
}

.correction-banner a:hover {
    text-decoration: underline;
}

/* ===== Footer ===== */
.site-footer {
    background-color: var(--muni-blue-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 0;
    font-size: 0.78rem;
    position: absolute;
    bottom: 0;
    width: 100%;
}

.site-footer .footer-contact a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.site-footer .footer-contact a:hover {
    color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .page-hero h1 { font-size: 1.2rem; }

    .table-card {
        padding: 0.5rem;
        border-radius: 8px;
    }

    .table-card table.dataTable thead th {
        font-size: 0.7rem;
        padding: 0.5rem;
    }

    .table-card table.dataTable tbody td {
        font-size: 0.8rem;
        padding: 0.45rem 0.5rem;
    }
}

/* ===== Focus ===== */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}
