:root {
    --bg: #f3f5fb;
    --card: #ffffff;
    --border: #dde3ef;
    --text: #172033;
    --muted: #6a7488;
    --primary: #2457ff;
    --primary-dark: #173fc3;
    --secondary-bg: #eef3ff;
    --secondary-text: #2742a5;
    --danger: #cf2f2f;
    --success: #0d8a42;
    --warning: #cc7a00;
    --info: #2957d1;
    --shadow: 0 8px 24px rgba(18, 28, 45, 0.06);
    --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    background: linear-gradient(180deg, #f7f9fd 0%, #f3f5fb 100%);
    color: var(--text);
    font-size: 14px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.wrap {
    width: min(1240px, calc(100% - 20px));
    margin: 0 auto;
}

/* HEADER */
.topbar {
    background: linear-gradient(135deg, #071b45 0%, #08112d 100%);
    color: #fff;
    padding: 12px 0;
    box-shadow: 0 8px 24px rgba(5, 15, 39, 0.25);
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
    letter-spacing: 0.2px;
}

.topbar .muted {
    color: #d6def7;
    margin-top: 4px;
    font-size: 13px;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.main-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.main-nav a {
    color: #fff;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background-color .2s ease, transform .2s ease;
    font-size: 13px;
}

.main-nav a:hover {
    background: rgba(255,255,255,.12);
    text-decoration: none;
    transform: translateY(-1px);
}

/* LAYOUT */
.main-content {
    padding: 16px 0 24px;
}

.footer {
    padding: 0 0 14px;
    font-size: 12px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.narrow {
    max-width: 980px;
    margin: 0 auto 16px;
}

.auth-card {
    max-width: 520px;
}

.success-card {
    text-align: center;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.section-header.compact {
    margin-bottom: 10px;
}

.section-header h2 {
    margin: 0;
    font-size: 18px;
}

.eyebrow {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--secondary-bg);
    color: var(--secondary-text);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 8px;
}

/* FORMULARIOS */
label {
    display: block;
    margin: 10px 0 6px;
    font-weight: 700;
    font-size: 13px;
}

input,
select,
textarea,
button {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

input,
select,
textarea {
    min-height: 38px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #8aa7ff;
    box-shadow: 0 0 0 3px rgba(36, 87, 255, .10);
}

textarea {
    resize: vertical;
    min-height: 72px;
}

.form-stack > * + * {
    margin-top: 4px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    margin-top: 0;
}

.help,
.muted {
    color: var(--muted);
    font-size: 13px;
}

.help {
    margin-top: 6px;
    line-height: 1.35;
}

/* BOTONES */
button,
.button-link {
    background: linear-gradient(135deg, var(--primary) 0%, #3a73ff 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(36, 87, 255, .14);
    text-decoration: none;
}

button:hover,
.button-link:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

button.secondary,
.button-link.secondary-link {
    background: var(--secondary-bg);
    color: var(--secondary-text);
    box-shadow: none;
    border: 1px solid #dbe5ff;
}

button.danger {
    background: linear-gradient(135deg, #dc4545 0%, var(--danger) 100%);
    box-shadow: 0 8px 18px rgba(207, 47, 47, .18);
}

button.small,
.button-link.small,
.auto-btn.small {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 9px;
}

.auto-btn,
.button-link {
    width: auto;
}

.button-link,
a.button-link,
.auto-btn,
button,
input[type="submit"],
input[type="button"] {
    border-radius: 10px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-decoration: none;
}

.button-link.small,
a.button-link.small,
button.small,
.auto-btn.small {
    border-radius: 9px !important;
}

/* FILAS / ACCIONES */
.row {
    display: flex;
    gap: 10px;
}

.row.between {
    justify-content: space-between;
}

.row.center {
    align-items: center;
}

.actions,
.actions-inline,
.toolbar,
.catalog-actions,
.quick-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.actions.right {
    justify-content: flex-end;
}

.wrap-actions > * {
    flex: 0 0 auto;
}

.inline-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0;
}

/* GRIDS */
.grid-2,
.grid-3,
.grid-4,
.grid-5 {
    display: grid;
    gap: 14px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid-setup {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 16px;
    align-items: start;
}

.stacked-cards {
    display: grid;
    gap: 16px;
}

.stack-sections {
    display: grid;
    gap: 16px;
}

.compact-gap {
    gap: 10px;
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-4 {
    grid-column: span 4;
}

.col-span-5 {
    grid-column: span 5;
}

/* ALERTAS */
.alert {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 13px;
}

.alert.danger {
    background: #fff1f1;
    border-color: #f3c6c6;
    color: #8e2121;
}

.alert.success {
    background: #eefcf4;
    border-color: #bee7cb;
    color: #146235;
}

.alert.warning {
    background: #fff8ea;
    border-color: #f2ddaa;
    color: #8d6200;
}

.alert.info {
    background: #eef4ff;
    border-color: #c9d8ff;
    color: #2049bb;
}

/* CHECKBOX */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.checkbox-row span {
    font-weight: 700;
}

.compact-check {
    min-height: 38px;
    align-self: end;
}

/* BIENES */
.bien-item {
    border: 1px dashed #ced7eb;
    border-radius: 14px;
    background: linear-gradient(180deg, #fcfdff 0%, #f8faff 100%);
    padding: 14px;
    margin-bottom: 14px;
}

.bien-header {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 10px;
}

.bien-grid {
    gap: 14px 12px;
}

.hidden {
    display: none;
}

.condicional-wrapper {
    display: block;
}

.form-top-grid {
    margin-bottom: 12px;
}

.home-ident-grid {
    margin-bottom: 10px;
}

.section-soft {
    border: 1px solid #e7ecf7;
    background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
    border-radius: 14px;
    padding: 14px;
}

/* TABLAS */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-bienes-table table {
    min-width: 1080px;
}

th,
td {
    padding: 9px 8px;
    border-bottom: 1px solid #e7ebf3;
    text-align: left;
    vertical-align: top;
}

thead th {
    background: #f7f9fd;
    color: #24314d;
    font-size: 12px;
    letter-spacing: .01em;
}

tr:hover td {
    background: #fbfcff;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #eefcf4;
    color: var(--success);
}

.badge.muted-badge {
    background: #eef1f7;
    color: #69758c;
}

/* DASHBOARD / GENERALES */
.stat-card {
    min-height: 120px;
}

.stat {
    font-size: 34px;
    font-weight: 800;
    margin-top: 6px;
}

.quick-links {
    margin-top: 12px;
}

.status-list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.simple-list {
    padding-left: 18px;
    margin: 10px 0 0;
}

.codeblock {
    background: #071430;
    color: #f6f8ff;
    border-radius: 12px;
    padding: 14px;
    overflow-x: auto;
    line-height: 1.35;
    font-size: 12px;
}

/* CATALOGOS */
.compact-card {
    max-width: 860px;
}

.catalog-list-card {
    width: 100%;
}

.catalog-list {
    display: grid;
    gap: 10px;
}

.catalog-line {
    display: grid;
    grid-template-columns: 48px minmax(180px, 1fr) 100px auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e7ebf3;
}

.catalog-line:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.catalog-line-id {
    font-size: 12px;
    font-weight: 700;
    color: #4f5c77;
}

.catalog-line-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* USUARIOS */
.users-admin-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.users-list-table {
    border: 1px solid #e6ebf5;
    border-radius: 14px;
    overflow: hidden;
}

.users-list-table table {
    min-width: 780px;
}

.users-list-table td,
.users-list-table th {
    vertical-align: middle;
}

.user-actions-stack {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-reset-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-reset-form input[type="text"] {
    width: 150px;
}

/* IMPORTACION / FORMULARIOS */
.form-grid {
    gap: 12px 14px;
}

.upload-grid {
    display: grid;
    gap: 14px;
}

.upload-actions {
    margin-top: 10px;
}

.upload-card-title {
    margin-bottom: 10px;
}

.form-bottom-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.form-bottom-actions > * {
    flex: 0 0 auto;
}

/* DASHBOARD NUEVO */
.dashboard-top-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.dashboard-kpi {
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    overflow: hidden;
    position: relative;
    padding-top: 4px;
    padding-bottom: 4px;
}

.dashboard-kpi::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 18px;
    background: rgba(0,0,0,0.08);
}

.dashboard-kpi-icon {
    position: absolute;
    right: 12px;
    top: 10px;
    font-size: 52px;
    opacity: 0.14;
    color: rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

.dashboard-kpi-value,
.dashboard-kpi-label {
    position: relative;
    z-index: 1;
}

.dashboard-kpi-value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.dashboard-kpi-label {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.dashboard-kpi-main {
    background: linear-gradient(135deg, #39c2c9 0%, #2eaeb4 100%);
}

.dashboard-top-cards .dashboard-kpi-accent:nth-child(2) {
    background: linear-gradient(135deg, #ff8c1a 0%, #ef7b0a 100%);
}

.dashboard-top-cards .dashboard-kpi-accent:nth-child(3) {
    background: linear-gradient(135deg, #6c63c7 0%, #5d56b0 100%);
}

.dashboard-top-cards .dashboard-kpi-accent:nth-child(4) {
    background: linear-gradient(135deg, #2d6cdf 0%, #2457c8 100%);
}

.dashboard-main-grid {
    align-items: stretch;
}

.dashboard-chart-box {
    height: 360px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-chart-box .section-header.compact {
    flex: 0 0 auto;
    margin-bottom: 8px;
}

.chart-card-fixed {
    height: 360px;
    overflow: hidden;
}

.chart-card-wrap.chart-card-compact {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chart-legend-scroll {
    flex: 0 0 auto;
    max-height: 56px;
    min-height: 56px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    border-bottom: 1px solid #e6ebf5;
}

.chart-legend-scroll::-webkit-scrollbar,
.dashboard-scroll-table::-webkit-scrollbar {
    width: 10px;
}

.chart-legend-scroll::-webkit-scrollbar-track,
.dashboard-scroll-table::-webkit-scrollbar-track {
    background: #eef2fb;
    border-radius: 999px;
}

.chart-legend-scroll::-webkit-scrollbar-thumb,
.dashboard-scroll-table::-webkit-scrollbar-thumb {
    background: #c4d0ea;
    border-radius: 999px;
}

.chart-legend-scroll::-webkit-scrollbar-thumb:hover,
.dashboard-scroll-table::-webkit-scrollbar-thumb:hover {
    background: #aebddf;
}

.chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 14px 8px 0;
    font-size: 13px;
    color: #4b5568;
}

.chart-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
    flex: 0 0 14px;
}

.chart-legend-text {
    white-space: nowrap;
}

.chart-canvas-wrap,
.chart-canvas-wrap-bars {
    position: relative;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.chart-canvas-wrap canvas,
.chart-canvas-wrap-bars canvas {
    width: 100% !important;
    height: 100% !important;
}

.dashboard-scroll-card {
    height: 360px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-sector-card {
    height: 360px;
}

.dashboard-scroll-table {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.dashboard-scroll-card .table-wrap {
    overflow: hidden;
}

.dashboard-scroll-card thead th,
.dashboard-sector-card thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f7f9fd;
}

@media (max-width: 1366px) {
    .wrap {
        width: min(1220px, calc(100% - 18px));
    }

    .dashboard-top-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .dashboard-top-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-setup {
        grid-template-columns: 1fr;
    }

    .dashboard-chart-box,
    .chart-card-fixed,
    .dashboard-scroll-card,
    .dashboard-sector-card {
        height: 320px;
    }

    .chart-legend-scroll {
        max-height: 52px;
        min-height: 52px;
    }

    .dashboard-scroll-table {
        max-height: 220px;
    }
}

@media (max-width: 768px) {
    .dashboard-top-cards {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-value {
        font-size: 28px;
    }

    .dashboard-kpi-label {
        font-size: 15px;
    }

    .dashboard-kpi-icon {
        font-size: 44px;
    }

    .dashboard-chart-box,
    .chart-card-fixed,
    .dashboard-scroll-card,
    .dashboard-sector-card {
        height: 300px;
    }

    .chart-legend-scroll {
        max-height: 48px;
        min-height: 48px;
    }

    .dashboard-scroll-table {
        max-height: 200px;
    }
}

/* ACCIONES EN LISTADO DE BIENES */
.admin-bienes-table .actions-cell {
    white-space: nowrap;
    width: 1%;
    text-align: center;
    vertical-align: middle;
}

.admin-bienes-table .actions-cell .inline-form {
    display: inline-flex;
    margin: 0;
}

.admin-bienes-table th.actions-col {
    white-space: nowrap;
    min-width: 150px;
    text-align: center;
}

/* RESPONSIVE */
@media (max-width: 1366px) {
    .wrap {
        width: min(1220px, calc(100% - 18px));
    }

    .dashboard-top-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .dashboard-top-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-setup {
        grid-template-columns: 1fr;
    }

    .chart-card-fixed,
    .dashboard-scroll-card,
    .dashboard-sector-card {
        height: auto;
    }

    .chart-card-compact {
        height: 380px;
        min-height: 380px;
        max-height: 380px;
    }

    .chart-legend-scroll {
        max-height: 80px;
        min-height: 80px;
    }

    .dashboard-scroll-table {
        max-height: 320px;
    }
}

@media (max-width: 980px) {
    .grid-4,
    .grid-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .users-list-table table {
        min-width: 680px;
    }
}

@media (max-width: 900px) {
    .grid-2,
    .grid-3,
    .grid-4,
    .grid-5 {
        grid-template-columns: 1fr;
    }

    .catalog-line {
        grid-template-columns: 1fr;
    }

    .catalog-line-actions {
        justify-content: flex-start;
    }

    .no-wrap-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
    }

    .main-nav a {
        padding: 8px 10px;
        font-size: 13px;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .grid-5,
    .grid-setup {
        grid-template-columns: 1fr !important;
    }

    .col-span-2,
    .col-span-4,
    .col-span-5 {
        grid-column: span 1 !important;
    }

    .row,
    .actions,
    .actions-inline,
    .toolbar,
    .quick-links,
    .form-bottom-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .auto-btn,
    .button-link,
    button {
        width: 100%;
    }

    .dashboard-top-cards {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-value {
        font-size: 28px;
    }

    .dashboard-kpi-label {
        font-size: 15px;
    }

    .dashboard-kpi-icon {
        font-size: 44px;
    }

    .chart-card-compact {
        height: 320px;
        min-height: 320px;
        max-height: 320px;
    }

    .chart-legend-scroll {
        max-height: 72px;
        min-height: 72px;
    }

    .dashboard-scroll-table {
        max-height: 260px;
    }

    .inline-reset-form {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .inline-reset-form input[type="text"] {
        width: 100%;
    }
}

/* SETUP BOTONES */
.setup-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.setup-actions-grid button {
    width: 100%;
    min-height: 40px;
}

.setup-actions-grid .setup-full-width {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .setup-actions-grid {
        grid-template-columns: 1fr;
    }

    .setup-actions-grid .setup-full-width {
        grid-column: auto;
    }
}

/* SETUP TARJETAS */
.grid-setup {
    align-items: start;
}

.stacked-cards .card {
    margin-bottom: 0;
}

.status-list {
    gap: 6px;
}

.simple-list li {
    margin-bottom: 4px;
}

/* =========================================
   CAMPOS EXTRA - AJUSTES VISUALES
========================================= */

.campos-extra-table {
    border: 1px solid #e6ebf5;
    border-radius: 14px;
    overflow: hidden;
}

.campos-extra-table table {
    min-width: 980px;
}

.campo-opciones {
    max-width: 280px;
    white-space: normal;
    color: #526079;
}

.campo-edit-row td {
    background: #fbfcff;
    padding: 0;
    border-bottom: 1px solid #e6ebf5;
}

.campo-edit-box {
    padding: 14px;
    border-top: 1px solid #eef2f9;
}

/* checks mejor alineados en alta y edición */
.campo-check-wrap {
    display: flex;
    align-items: center;
    min-height: 100%;
    padding-top: 22px;
}

.campo-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-height: 38px;
}

.campo-check-inline input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.campo-check-inline span {
    font-weight: 700;
    line-height: 1.2;
}

/* ayudas más chicas y contenidas */
.campos-extra-table .help,
.campo-edit-box .help,
.campos-extra-form .help {
    font-size: 11px;
    line-height: 1.35;
    max-width: 100%;
    display: block;
    white-space: normal;
    word-break: break-word;
    margin-top: 5px;
}

/* si querés que toda ayuda general baje un poco */
.campos-extra-form .help {
    color: var(--muted);
}

/* inputs y selects del bloque de campos extra */
.campos-extra-form input[type="text"],
.campos-extra-form select {
    width: 100%;
}

/* mejor respiración visual */
.campos-extra-form {
    gap: 12px 14px;
}

.campos-extra-form .actions {
    margin-top: 4px;
}

/* nombre interno visualmente técnico pero prolijo */
.campos-extra-table code {
    background: #f2f5fb;
    border: 1px solid #e2e8f5;
    border-radius: 8px;
    padding: 3px 7px;
    font-size: 12px;
    color: #334155;
}

/* responsive */
@media (max-width: 768px) {
    .campo-check-wrap {
        padding-top: 10px;
    }

    .campos-extra-table table {
        min-width: 760px;
    }
}

.extras-dinamicos-wrap {
    margin-top: 6px;
}

.extras-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 14px;
    padding: 12px;
    border: 1px dashed #d9e2f0;
    border-radius: 12px;
    background: #fafcff;
}

@media (max-width: 768px) {
    .extras-grid {
        grid-template-columns: 1fr;
    }
}

/* Fondo tenue por condición del bien */
#tabla-bienes tbody tr.row-estado-en-uso > td {
    background: rgba(21, 128, 61, 0.06);
}

#tabla-bienes tbody tr.row-estado-en-stock > td {
    background: rgba(29, 78, 216, 0.06);
}

#tabla-bienes tbody tr.row-estado-danado > td,
#tabla-bienes tbody tr.row-estado-dañado > td {
    background: rgba(220, 38, 38, 0.06);
}

#tabla-bienes tbody tr.row-estado-en-reparacion > td,
#tabla-bienes tbody tr.row-estado-en-reparación > td {
    background: rgba(217, 119, 6, 0.07);
}

#tabla-bienes tbody tr.row-estado-obsoleto > td {
    background: rgba(75, 85, 99, 0.08);
}

#tabla-bienes tbody tr.row-estado-baja > td {
    background: rgba(153, 27, 27, 0.08);
}

#tabla-bienes tbody tr.row-estado-prestado > td {
    background: rgba(124, 58, 237, 0.06);
}

#tabla-bienes tbody tr.row-estado-sin-revisar > td {
    background: rgba(107, 114, 128, 0.06);
}

/* Hover suave encima del color base */
#tabla-bienes tbody tr.row-estado-en-uso:hover > td {
    background: rgba(21, 128, 61, 0.10);
}

#tabla-bienes tbody tr.row-estado-en-stock:hover > td {
    background: rgba(29, 78, 216, 0.10);
}

#tabla-bienes tbody tr.row-estado-danado:hover > td,
#tabla-bienes tbody tr.row-estado-dañado:hover > td {
    background: rgba(220, 38, 38, 0.10);
}

#tabla-bienes tbody tr.row-estado-en-reparacion:hover > td,
#tabla-bienes tbody tr.row-estado-en-reparación:hover > td {
    background: rgba(217, 119, 6, 0.11);
}

#tabla-bienes tbody tr.row-estado-obsoleto:hover > td {
    background: rgba(75, 85, 99, 0.11);
}

#tabla-bienes tbody tr.row-estado-baja:hover > td {
    background: rgba(153, 27, 27, 0.11);
}

#tabla-bienes tbody tr.row-estado-prestado:hover > td {
    background: rgba(124, 58, 237, 0.10);
}

#tabla-bienes tbody tr.row-estado-sin-revisar:hover > td {
    background: rgba(107, 114, 128, 0.10);
}

.page-header {
    margin-bottom: 24px;
}

.section-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.2rem;
}

.table-responsive {
    overflow-x: auto;
}

.info-grid {
    display: grid;
    gap: 16px;
}

.info-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-item label {
    display: block;
    font-size: 0.9rem;
    color: #667085;
    margin-bottom: 6px;
    font-weight: 600;
}

.assignment-form .form-grid {
    display: grid;
    gap: 16px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    font-size: 1rem;
    box-sizing: border-box;
}

.actions-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    align-items: center;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid #d0d5dd;
    color: #344054;
    background: #fff;
}

.mt-2 {
    margin-top: 12px;
}

.mt-3 {
    margin-top: 18px;
}

@media (max-width: 900px) {
    .info-grid-3,
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .actions-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.actions-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-danger {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid #d92d20;
    color: #fff;
    background: #d92d20;
    cursor: pointer;
}

.btn-danger:hover {
    opacity: 0.92;
}

.assignment-form .catalog-actions {
    margin-top: 18px;
}

.assignment-form .catalog-actions .auto-btn,
.assignment-form .catalog-actions .danger {
    width: auto;
    min-width: 140px;
}

.assignment-form textarea {
    min-height: 90px;
}

.assignment-form .table th,
.assignment-form .table td {
    vertical-align: middle;
}

.observaciones-bloque {
    margin-top: 12px;
}

.observaciones-bloque strong {
    display: block;
    margin-bottom: 6px;
}

.observaciones-texto {
    line-height: 1.5;
    color: #1f2937;
}

.badge-extra {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.badge-estado-en-uso {
    background: #e8f7ee;
    color: #15803d;
}

.badge-estado-en-stock {
    background: #eaf2ff;
    color: #1d4ed8;
}

.badge-estado-danado,
.badge-estado-dañado {
    background: #fdecec;
    color: #dc2626;
}

.badge-estado-en-reparacion,
.badge-estado-en-reparación {
    background: #fff4e5;
    color: #d97706;
}

.badge-estado-obsoleto {
    background: #eceff3;
    color: #4b5563;
}

.badge-estado-baja {
    background: #f3e8ea;
    color: #991b1b;
}

.badge-estado-prestado {
    background: #f3e8ff;
    color: #7c3aed;
}

.badge-estado-sin-definir {
    background: #f3f4f6;
    color: #6b7280;
}

.observaciones-bloque {
    margin-top: 12px;
}

.observaciones-bloque strong {
    display: block;
    margin-bottom: 6px;
}

.observaciones-texto {
    line-height: 1.5;
    color: #1f2937;
}

.firma-box-wrap {
    border: 1px solid #d0d5dd;
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    margin-bottom: 16px;
    overflow: auto;
}

#firma-pad {
    display: block;
    width: 100%;
    height: 220px;
    max-width: 100%;
    background: #fff;
    border-radius: 10px;
    touch-action: none;
    cursor: crosshair;
}

.acciones-link-firma {
    margin-top: 14px;
}

.btn-link-firma {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    color: #fff !important;
    border: 1px solid #2563eb;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.btn-link-firma:hover {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
    color: #fff !important;
}

#btn-abrir-link-firma {
    margin-top: 12px;
}

.user-signature-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 180px;
    max-width: 180px;
}

.user-signature-cell input[type="file"] {
    width: 100%;
    max-width: 180px;
    font-size: 12px;
}

.signature-preview-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 62px;
    padding: 4px 8px;
    border: 1px solid #d0d7e2;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
}

.signature-preview {
    max-height: 46px;
    max-width: 160px;
    width: auto;
    height: auto;
    display: block;
}

.users-list-table table td,
.users-list-table table th {
    vertical-align: middle;
}

.users-list-table table td form.inline-form {
    margin: 0;
}

.acciones-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.acciones-icon-wrap .inline-form {
    margin: 0;
}

.icon-action-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid transparent;
    font-size: 15px;
    line-height: 1;
    transition: all 0.18s ease;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}

button.icon-action-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
}

.icon-action-btn i {
    pointer-events: none;
    font-size: 15px;
    line-height: 1;
}

/* Asignaciones */
.icon-action-asignar {
    background: #E8F0FE;
    border-color: #D2E3FC;
    color: #1A73E8 !important;
}

.icon-action-asignar:hover {
    background: #DCE8FD;
    border-color: #AECBFA;
    color: #1557B0 !important;
    transform: translateY(-1px);
}

/* Ver */
.icon-action-ver {
    background: #F1F3F4;
    border-color: #DADCE0;
    color: #5F6368 !important;
}

.icon-action-ver:hover {
    background: #E8EAED;
    border-color: #BDC1C6;
    color: #3C4043 !important;
    transform: translateY(-1px);
}

/* Eliminar */
.icon-action-eliminar {
    background: #FCE8E6;
    border-color: #F6C7C3;
    color: #D93025 !important;
    cursor: pointer;
}

.icon-action-eliminar:hover {
    background: #FAD2CF;
    border-color: #F1A7A0;
    color: #B3261E !important;
    transform: translateY(-1px);
}

#tabla-bienes td.actions-cell {
    text-align: center;
    vertical-align: middle;
}

.icon-action-link {
    background: #E8F5E9;
    border-color: #CDE8D1;
    color: #15803D !important;
}

.icon-action-link:hover {
    background: #DCF0DF;
    border-color: #B7DEBE;
    color: #166534 !important;
    transform: translateY(-1px);
}

.movimientos-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.movimientos-toolbar label {
    margin: 0;
    font-weight: 600;
}

.movimientos-toolbar select {
    width: auto;
    min-width: 80px;
}

.table-pagination {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.pagination-dots {
    color: var(--muted);
    font-weight: 700;
    padding: 0 4px;
}

/* =========================================
   ADMIN BIENES - TOOLBAR / POPOVER / PAGINACION
========================================= */

.bienes-toolbar-floating {
    position: relative;
}

.bienes-toolbar-right {
    gap: 6px;
}

.toolbar-icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-sizing: border-box;
    box-shadow: none;
}

.toolbar-icon-btn i {
    font-size: 14px;
    line-height: 1;
}

/* Excel */
.toolbar-export-btn {
    background: #EBF7F0 !important;
    color: #217346 !important;
    border: 1px solid #C3E6CB !important;
    box-shadow: none !important;
}

.toolbar-export-btn:hover {
    background: #E4F3EA !important;
    color: #1B5E3A !important;
    border-color: #B8DDC2 !important;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Columnas */
.toolbar-columns-btn {
    background: #F8F9FA !important;
    color: #6C757D !important;
    border: 1px solid #DEE2E6 !important;
    box-shadow: none !important;
}

.toolbar-columns-btn:hover {
    background: #F1F3F5 !important;
    color: #5F6870 !important;
    border-color: #D5DAE0 !important;
    text-decoration: none;
    transform: translateY(-1px);
}

.columnas-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: 90vw;
    background: #fff;
    border: 1px solid #d9dfeb;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(16, 24, 40, 0.18);
    padding: 14px;
    z-index: 1000;
}

.columnas-popover.hidden {
    display: none;
}

.columnas-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.columnas-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #5b6475;
    width: auto;
    min-height: auto;
    padding: 0;
    box-shadow: none;
}

.columnas-toolbar {
    margin-bottom: 10px;
}

.columnas-toolbar input {
    width: 100%;
}

.columnas-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.columnas-group {
    margin-bottom: 12px;
}

.columnas-group:last-child {
    margin-bottom: 0;
}

.columnas-group-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #5d6980;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.columnas-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
}

.item-columna {
    margin: 0;
    min-height: auto;
}

.item-columna span {
    font-weight: 600;
}

.columnas-mini-btn {
    min-height: 32px;
    padding: 4px 9px;
    font-size: 0.8rem;
    border-radius: 999px;
    width: auto;
}

/* =========================================
   ADMIN BIENES - TABLA / ACCIONES
========================================= */

.acciones-header {
    text-align: center !important;
}

#tabla-bienes th.acciones-header {
    text-align: center !important;
}

.admin-bienes-table .actions-cell {
    white-space: nowrap;
    width: 1%;
    text-align: center;
    vertical-align: middle;
}

.admin-bienes-table .actions-cell .inline-form {
    display: inline-flex;
    margin: 0;
}

.admin-bienes-table th.actions-col {
    white-space: nowrap;
    min-width: 150px;
    text-align: center;
}

#tabla-bienes td.actions-cell {
    text-align: center;
    vertical-align: middle;
}

.acciones-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.acciones-icon-wrap .inline-form {
    margin: 0;
}

.icon-action-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid transparent;
    font-size: 15px;
    line-height: 1;
    transition: all 0.18s ease;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}

button.icon-action-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
}

.icon-action-btn i {
    pointer-events: none;
    font-size: 15px;
    line-height: 1;
}

.icon-action-asignar {
    background: #E8F0FE;
    border-color: #D2E3FC;
    color: #1A73E8 !important;
}

.icon-action-asignar:hover {
    background: #DCE8FD;
    border-color: #AECBFA;
    color: #1557B0 !important;
    transform: translateY(-1px);
}

.icon-action-ver {
    background: #F1F3F4;
    border-color: #DADCE0;
    color: #5F6368 !important;
}

.icon-action-ver:hover {
    background: #E8EAED;
    border-color: #BDC1C6;
    color: #3C4043 !important;
    transform: translateY(-1px);
}

.icon-action-eliminar {
    background: #FCE8E6;
    border-color: #F6C7C3;
    color: #D93025 !important;
    cursor: pointer;
}

.icon-action-eliminar:hover {
    background: #FAD2CF;
    border-color: #F1A7A0;
    color: #B3261E !important;
    transform: translateY(-1px);
}

/* =========================================
   ADMIN BIENES - PAGINACION
========================================= */

.table-pagination {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.table-pagination-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.pagination-dots {
    color: var(--muted);
    font-weight: 700;
    padding: 0 4px;
}

.pagination-arrow {
    min-width: 34px;
    width: 34px;
    padding: 0 !important;
    font-size: 16px;
}

.movimientos-toolbar-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
}

.movimientos-toolbar-bottom label {
    margin: 0;
    font-weight: 600;
}

.movimientos-toolbar-bottom select {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    min-height: 32px;
    height: 32px;
    padding: 4px 8px;
    font-size: 13px;
    border-radius: 10px;
}

.goto-input {
    width: 58px;
    min-width: 58px;
    height: 32px;
    padding: 4px 8px;
}

.goto-submit-btn {
    min-width: 40px;
    padding: 0 10px;
}

.goto-form-bienes {
    margin-left: 4px;
}

/* =========================================
   ADMIN BIENES - BADGES / DETALLES
========================================= */

.col-estado-bien {
    min-width: 120px;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 900px) {
    .bienes-toolbar-right {
        width: 100%;
        justify-content: flex-start;
    }

    .table-pagination-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .pagination-links {
        justify-content: flex-start;
    }
}

/* =========================================
   AJUSTE FINAL - BIENES IGUAL A MOVIMIENTOS
========================================= */

/* Iconos superiores un poco mas grandes */
.toolbar-icon-btn {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    border-radius: 12px !important;
}

.toolbar-icon-btn i {
    font-size: 15px !important;
}

/* Excel */
.toolbar-export-btn {
    background: #EBF7F0 !important;
    color: #217346 !important;
    border: 1px solid #C3E6CB !important;
    box-shadow: none !important;
}

.toolbar-export-btn:hover {
    background: #E2F3E8 !important;
    color: #1B5E3A !important;
    border-color: #B8DDC2 !important;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Columnas */
.toolbar-columns-btn {
    background: #F8F9FA !important;
    color: #6C757D !important;
    border: 1px solid #DEE2E6 !important;
    box-shadow: none !important;
}

.toolbar-columns-btn:hover {
    background: #F1F3F5 !important;
    color: #5F6870 !important;
    border-color: #D5DAE0 !important;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Acciones de bienes: exactamente mismo look que movimientos */
.admin-bienes-table .icon-action-btn,
#tabla-bienes .icon-action-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid transparent !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.admin-bienes-table .icon-action-btn i,
#tabla-bienes .icon-action-btn i {
    font-size: 15px !important;
    line-height: 1 !important;
}

/* Ver */
.admin-bienes-table .icon-action-ver,
#tabla-bienes .icon-action-ver {
    background: #F1F3F4 !important;
    border-color: #DADCE0 !important;
    color: #5F6368 !important;
}

.admin-bienes-table .icon-action-ver:hover,
#tabla-bienes .icon-action-ver:hover {
    background: #E8EAED !important;
    border-color: #BDC1C6 !important;
    color: #3C4043 !important;
    transform: translateY(-1px);
}

/* Eliminar */
.admin-bienes-table .icon-action-eliminar,
#tabla-bienes .icon-action-eliminar {
    background: #FCE8E6 !important;
    border-color: #F6C7C3 !important;
    color: #D93025 !important;
}

.admin-bienes-table .icon-action-eliminar:hover,
#tabla-bienes .icon-action-eliminar:hover {
    background: #FAD2CF !important;
    border-color: #F1A7A0 !important;
    color: #B3261E !important;
    transform: translateY(-1px);
}

.button-link.danger,
a.button-link.danger {
    background: linear-gradient(135deg, #dc4545 0%, var(--danger) 100%);
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(207, 47, 47, .18);
    border: none;
}

.button-link.danger:hover,
a.button-link.danger:hover {
    color: #fff !important;
    text-decoration: none;
    transform: translateY(-1px);
}

.icon-action-print {
    background: #FFF4E5;
    border-color: #F2D3A2;
    color: #B96A00 !important;
}

.icon-action-print:hover {
    background: #FCE8C6;
    border-color: #E7BE7A;
    color: #8A4F00 !important;
    transform: translateY(-1px);
}

.importar-toolbar-download {
    margin-top: 14px;
}

.toolbar-download-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 12px;
    padding: 8px 12px 8px 8px;
    transition: all 0.18s ease;
}

.toolbar-download-link:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.toolbar-download-link .toolbar-icon-btn {
    flex: 0 0 auto;
}

.toolbar-download-link-excel {
    background: #EBF7F0;
    border: 1px solid #C3E6CB;
    color: #217346 !important;
}

.toolbar-download-link-excel:hover {
    background: #E2F3E8;
    border-color: #B8DDC2;
    color: #1B5E3A !important;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logos {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-logo {
    max-height: 54px;
    width: auto;
    display: block;
    object-fit: contain;
}

.brand-text h1 {
    margin: 0;
}

.brand-text p {
    margin: 4px 0 0;
}

@media (max-width: 768px) {
    .brand-block {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .brand-logos {
        gap: 8px;
    }

    .brand-logo {
        max-height: 42px;
    }
}