/* =====================================================================
   AdminTrek — sistema de diseño con la identidad de trekrental.com
   Naranjo #FF6702 (marca) · Negro #231F20 (logo) · Azul #009CFF (acento)
   ===================================================================== */

:root {
    --trek: #FF6702;
    --trek-600: #E85D00;
    --trek-700: #C24E00;
    --trek-50: #FFF4EC;
    --trek-100: #FFE3CF;
    --ink: #231F20;
    --ink-2: #3A3536;
    --accent: #009CFF;
    --accent-50: #E8F6FF;

    --bg: #F5F6F8;
    --surface: #FFFFFF;
    --line: #E7E9EE;
    --line-2: #F0F1F4;
    --muted: #6B7280;
    --muted-2: #9AA0AA;

    --sidebar-w: 264px;
    --sidebar-w-mini: 76px;
    --topbar-h: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);

    /* Bootstrap */
    --bs-primary: var(--trek);
    --bs-primary-rgb: 255, 103, 2;
    --bs-link-color: var(--trek-700);
    --bs-link-color-rgb: 194, 78, 0;
    --bs-link-hover-color: var(--trek);
    --bs-body-font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: var(--ink);
    --bs-body-bg: #FFFFFF;
    --bs-border-color: var(--line);
    --bs-border-radius: var(--radius-sm);
    --bs-focus-ring-color: rgba(255, 103, 2, .25);
}

html { font-size: 14px; }
body { background: var(--bg); color: var(--ink); min-height: 100vh; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .card-title { font-family: "Montserrat", var(--bs-body-font-family); font-weight: 700; letter-spacing: -.01em; }
a { color: var(--trek-700); }
a:hover { color: var(--trek); }
::selection { background: var(--trek-100); }

/* ===== Sidebar ===================================================== */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
    background: var(--surface); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; z-index: 1040;
    transition: width .2s ease, transform .2s ease;
}
.sidebar-brand {
    height: var(--topbar-h); display: flex; align-items: center; gap: .6rem;
    padding: 0 1.25rem; border-bottom: 1px solid var(--line-2); flex-shrink: 0;
}
.sidebar-brand img.logo { height: 30px; width: auto; }
.sidebar-brand img.isotipo { height: 34px; width: 34px; border-radius: 8px; display: none; }
.sidebar-brand .tag {
    font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--trek-700); background: var(--trek-50); padding: .15rem .45rem; border-radius: 6px;
}
.sidebar-nav { padding: .75rem .75rem 1rem; overflow-y: auto; flex: 1; }
.sidebar-section {
    padding: 1rem .75rem .4rem; font-size: .7rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); white-space: nowrap;
}
.sidebar-nav a {
    display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; margin-bottom: 2px;
    border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 500;
    white-space: nowrap; position: relative; transition: background .15s, color .15s;
}
.sidebar-nav a i { font-size: 1.1rem; width: 1.25rem; text-align: center; color: var(--muted); transition: color .15s; }
.sidebar-nav a:hover { background: var(--line-2); color: var(--ink); }
.sidebar-nav a:hover i { color: var(--ink); }
.sidebar-nav a.active { background: var(--trek-50); color: var(--trek-700); font-weight: 600; }
.sidebar-nav a.active i { color: var(--trek); }
.sidebar-nav a.active::before {
    content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 3px;
    background: var(--trek); border-radius: 0 3px 3px 0;
}
.sidebar-footer {
    padding: .9rem 1.25rem; border-top: 1px solid var(--line-2); font-size: .75rem; color: var(--muted-2);
    display: flex; align-items: center; gap: .5rem; white-space: nowrap;
}
.sidebar-footer a { color: var(--muted); text-decoration: none; }
.sidebar-footer a:hover { color: var(--trek); }

/* Sidebar compacta (solo íconos) en escritorio */
@media (min-width: 992px) {
    body.sidebar-mini .sidebar { width: var(--sidebar-w-mini); }
    body.sidebar-mini .sidebar-brand { justify-content: center; padding: 0; }
    body.sidebar-mini .sidebar-brand img.logo,
    body.sidebar-mini .sidebar-brand .tag,
    body.sidebar-mini .sidebar-nav a span,
    body.sidebar-mini .sidebar-footer span { display: none; }
    body.sidebar-mini .sidebar-brand img.isotipo { display: block; }
    body.sidebar-mini .sidebar-section { font-size: 0; padding: .6rem 0; border-top: 1px solid var(--line-2); margin: .4rem .5rem 0; }
    body.sidebar-mini .sidebar-nav a { justify-content: center; padding: .7rem 0; }
    body.sidebar-mini .sidebar-footer { justify-content: center; padding: .9rem 0; }
    body.sidebar-mini .topbar, body.sidebar-mini .main { margin-left: var(--sidebar-w-mini); }
}

/* ===== Topbar ====================================================== */
.topbar {
    position: sticky; top: 0; z-index: 1030; height: var(--topbar-h);
    display: flex; align-items: center; gap: 1rem; padding: 0 1.75rem;
    background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}
.topbar .btn-toggle {
    border: 0; background: transparent; color: var(--muted); width: 38px; height: 38px;
    border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center;
}
.topbar .btn-toggle:hover { background: var(--line-2); color: var(--ink); }
.topbar-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.topbar-title h1 { font-size: 1.15rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .crumbs { font-size: .78rem; color: var(--muted-2); }
.topbar-title .crumbs a { color: var(--muted); text-decoration: none; }
.topbar-title .crumbs a:hover { color: var(--trek); }

.pais-switch .btn {
    display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--line);
    background: var(--surface); border-radius: 999px; padding: .3rem .8rem .3rem .4rem; font-weight: 600; color: var(--ink);
}
.pais-switch .btn:hover { border-color: var(--trek-100); background: var(--trek-50); }
.flag { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.pais-switch .dropdown-item { display: flex; align-items: center; gap: .6rem; }

.user-menu .btn { display: inline-flex; align-items: center; gap: .6rem; border: 0; background: transparent; padding: .25rem .4rem; border-radius: 999px; }
.user-menu .btn:hover { background: var(--line-2); }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--ink); color: #fff; font-weight: 700; font-size: .85rem; letter-spacing: .02em; flex-shrink: 0;
}
.user-menu .nombre { font-weight: 600; font-size: .9rem; line-height: 1.1; text-align: left; }
.user-menu .rol { font-size: .72rem; color: var(--muted); }

/* ===== Contenido =================================================== */
body.con-sidebar .topbar, body.con-sidebar .main { margin-left: var(--sidebar-w); transition: margin-left .2s ease; }
.main { padding: 1.75rem; max-width: 1600px; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.sidebar-abierto .sidebar { transform: none; }
    body.sidebar-abierto .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(17, 17, 17, .45); z-index: 1035; }
    body.con-sidebar .topbar, body.con-sidebar .main { margin-left: 0; }
    .topbar { padding: 0 1rem; }
    .main { padding: 1rem; }
}

.page-header { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header h2 { font-size: 1.35rem; margin: 0; }
.page-header p { margin: .25rem 0 0; color: var(--muted); }
.page-header .acciones { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ===== Cards ======================================================= */
.card {
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    background: var(--surface); --bs-card-cap-bg: var(--surface);
}
.card > .card-header {
    background: var(--surface); border-bottom: 1px solid var(--line-2);
    padding: 1rem 1.25rem; border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-header .card-title, .card-header h5, .card-header h6 { font-size: 1rem; margin: 0; color: var(--ink); }
.card-body { padding: 1.25rem; }
.card-footer { background: var(--surface); border-top: 1px solid var(--line-2); }

/* Encabezados naranjos heredados de RentalWeb (.bg-trek): se presentan como encabezado limpio con acento de marca */
.card-header.bg-trek {
    background: var(--surface) !important; color: var(--ink) !important;
    border-bottom: 1px solid var(--line-2); position: relative; padding-left: 1.5rem;
}
.card-header.bg-trek::before {
    content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px;
    background: var(--trek); border-radius: 0 4px 4px 0;
}
/* Solo los títulos (traen style="color:white" en línea); los botones conservan sus colores */
.card-header.bg-trek > :is(h1, h2, h3, h4, h5, h6, .card-title, span, div:not(.toolbar-actions):not(.d-flex)) { color: var(--ink) !important; }
.bg-trek:not(.card-header) { background-color: var(--trek) !important; color: #fff; }

/* Contenedores heredados del tema W3CRM */
.content-body > .container-fluid { padding-left: 0; padding-right: 0; margin-top: 0 !important; }

/* ===== Botones ===================================================== */
.btn { font-weight: 600; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn-primary, .btn-trek, input.btn-trek, .btn-trek-xs, .btn-trek-secondary-xs {
    --bs-btn-bg: var(--trek); --bs-btn-border-color: var(--trek);
    --bs-btn-hover-bg: var(--trek-600); --bs-btn-hover-border-color: var(--trek-600);
    --bs-btn-active-bg: var(--trek-700); --bs-btn-active-border-color: var(--trek-700);
    --bs-btn-disabled-bg: var(--trek); --bs-btn-disabled-border-color: var(--trek);
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
    --bs-btn-focus-shadow-rgb: 255, 103, 2;
}
.btn-trek, input.btn-trek, .btn-trek-xs, .btn-trek-secondary-xs {
    background: var(--trek); border: 1px solid var(--trek); color: #fff; border-radius: var(--radius-sm);
    font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1rem; transition: background .15s, box-shadow .15s; line-height: 1.4; text-decoration: none;
}
.btn-trek:hover, input.btn-trek:hover, .btn-trek-xs:hover, .btn-trek-secondary-xs:hover { background: var(--trek-600); border-color: var(--trek-600); color: #fff; }
.btn-trek:focus-visible, .btn-trek-xs:focus-visible, .btn-trek-secondary-xs:focus-visible { box-shadow: 0 0 0 .25rem rgba(255, 103, 2, .25); outline: 0; }
.btn-trek-xs, .btn-trek-secondary-xs { padding: .4rem .85rem; font-size: .85rem; }
.btn-outline-primary {
    --bs-btn-color: var(--trek-700); --bs-btn-border-color: var(--trek-100);
    --bs-btn-hover-bg: var(--trek-50); --bs-btn-hover-color: var(--trek-700); --bs-btn-hover-border-color: var(--trek);
    --bs-btn-active-bg: var(--trek-100); --bs-btn-active-color: var(--trek-700); --bs-btn-active-border-color: var(--trek);
}
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--line-2); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--line); }
.btn-outline-danger { --bs-btn-border-color: #F5C2C7; }
.btn-success { --bs-btn-bg: var(--trek); --bs-btn-border-color: var(--trek); --bs-btn-hover-bg: var(--trek-600); --bs-btn-hover-border-color: var(--trek-600); --bs-btn-active-bg: var(--trek-700); --bs-btn-active-border-color: var(--trek-700); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-disabled-bg: var(--trek); --bs-btn-disabled-border-color: var(--trek); }
.btn-dark { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); }

/* Botones de acción de tablas (íconos) */
.btn-icon {
    width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--line);
    background: var(--surface); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .15s; padding: 0; margin: 0 2px; vertical-align: middle;
}
.btn-icon i { font-size: .95rem; line-height: 1; }
.btn-icon:hover { border-color: var(--trek-100); background: var(--trek-50); color: var(--trek-700); }
.btn-icon-edit:hover, .btn-icon-view:hover { border-color: #B8E2FF; background: var(--accent-50); color: #0077C2; }
.btn-icon-upload:hover { border-color: var(--trek-100); background: var(--trek-50); color: var(--trek-700); }
.btn-icon-delete:hover { border-color: #F5C2C7; background: #FDECEE; color: #C62828; }
.actions-column { white-space: nowrap; text-align: center; width: 1%; }
.toolbar-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ===== Formularios ================================================= */
.form-control, .form-select { border-color: var(--line); border-radius: var(--radius-sm); padding: .5rem .75rem; }
.form-control-sm, .form-select-sm, .form-control-xs { padding: .4rem .65rem; font-size: .875rem; border-radius: var(--radius-sm); }
.form-control-file-xs { font-size: .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--trek); box-shadow: 0 0 0 .2rem rgba(255, 103, 2, .15); }
.form-label, .control-label { font-weight: 600; font-size: .85rem; color: var(--ink-2); margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--trek); border-color: var(--trek); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(255, 103, 2, .2); border-color: var(--trek); }
.form-group { margin-bottom: 1rem; }
.form-text, small.text-muted { color: var(--muted) !important; }
.input-validation-error { border-color: #dc3545 !important; }
.ml-2 { margin-left: .5rem !important; }
.mr-2 { margin-right: .5rem !important; }

/* ===== Tablas / DataTables ======================================== */
.table { --bs-table-hover-bg: #FFF9F5; margin-bottom: 0; vertical-align: middle; }
.table > :not(caption) > * > * { padding: .75rem .85rem; border-bottom-color: var(--line-2); }
.table thead th, .table thead.table-dark th {
    background: #FAFAFB !important; color: var(--muted) !important; font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line) !important; white-space: nowrap;
}
.table-bordered > :not(caption) > * > * { border-width: 0 0 1px 0; }
.table-bordered { border: 0; }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: transparent; }
div.dataTables_wrapper { padding-top: .25rem; }
div.dataTables_wrapper div.dataTables_length select { width: auto; display: inline-block; margin: 0 .35rem; }
div.dataTables_wrapper div.dataTables_filter input {
    margin-left: .5rem; width: 240px; padding-left: 2rem; border-radius: 999px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%239AA0AA' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E") no-repeat .75rem center;
}
div.dataTables_wrapper div.dataTables_info { color: var(--muted); font-size: .85rem; padding-top: 1rem; }
div.dataTables_wrapper div.dataTables_paginate { padding-top: .75rem; }
.page-link { color: var(--ink-2); border-color: var(--line); }
.page-link:hover { color: var(--trek-700); background: var(--trek-50); }
.active > .page-link, .page-link.active { background: var(--trek); border-color: var(--trek); color: #fff; }
table.dataTable { width: 100% !important; border-collapse: collapse !important; }
table.dataTable > tbody > tr.child ul.dtr-details { width: 100%; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before { background-color: var(--trek); }

/* ===== Badges / estados =========================================== */
.badge { font-weight: 600; padding: .35em .65em; border-radius: 6px; letter-spacing: .01em; }
.badge.bg-success, .badge.text-bg-success { background: #E7F6EC !important; color: #1E7B3A !important; }
.badge.bg-danger, .badge.text-bg-danger { background: #FDECEE !important; color: #B42318 !important; }
.badge.bg-warning, .badge.text-bg-warning { background: #FFF6E0 !important; color: #8A5A00 !important; }
.badge.bg-secondary, .badge.text-bg-secondary { background: var(--line-2) !important; color: var(--ink-2) !important; }
.badge.bg-info, .badge.text-bg-info { background: var(--accent-50) !important; color: #0069A8 !important; }
.badge.bg-primary, .badge.text-bg-primary { background: var(--trek-50) !important; color: var(--trek-700) !important; }
.badge.text-bg-dark { background: var(--ink) !important; color: #fff !important; }
.estado-dot { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .85rem; }
.estado-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ===== Modales / alertas ========================================== */
.modal-content { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line-2); padding: 1.1rem 1.5rem; }
.modal-header .modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-header.bg-trek, .modal-header.bg-primary { background: var(--surface) !important; color: var(--ink) !important; }
.modal-header.bg-trek .btn-close-white, .modal-header.bg-primary .btn-close-white { filter: none; }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer { border-top: 1px solid var(--line-2); padding: .9rem 1.5rem; background: #FCFCFD; border-radius: 0 0 var(--radius) var(--radius); }
.alert { border-radius: var(--radius-sm); border: 0; }
.alert-success { background: #E7F6EC; color: #1E5E33; }
.alert-danger { background: #FDECEE; color: #8C1D18; }
.alert-info { background: var(--accent-50); color: #00548A; }
.nav-tabs { border-bottom: 1px solid var(--line); gap: .25rem; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; padding: .65rem 1rem; }
.nav-tabs .nav-link:hover { color: var(--ink); border-bottom-color: var(--line); }
.nav-tabs .nav-link.active { color: var(--trek-700); border-bottom-color: var(--trek); background: transparent; }

/* SweetAlert2 con colores de marca */
.swal2-popup { border-radius: var(--radius) !important; font-family: var(--bs-body-font-family) !important; }
.swal2-styled.swal2-confirm { background-color: var(--trek) !important; border-radius: var(--radius-sm) !important; }
.swal2-styled.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(255, 103, 2, .3) !important; }
.swal2-styled.swal2-cancel { background-color: #EEF0F3 !important; color: var(--ink) !important; border-radius: var(--radius-sm) !important; }
.swal2-icon.swal2-warning { border-color: var(--trek) !important; color: var(--trek) !important; }

/* SunEditor */
.sun-editor { font-size: 14px; border-radius: var(--radius-sm); border-color: var(--line) !important; }
.sun-editor .se-toolbar { background: #FAFAFB; outline-color: var(--line); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }

/* ===== Miniaturas y visor ========================================= */
.thumb {
    width: 64px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--line-2);
    box-shadow: 0 0 0 1px var(--line); cursor: zoom-in; transition: transform .15s, box-shadow .15s; display: block; flex-shrink: 0;
}
.thumb:hover { transform: scale(1.04); box-shadow: 0 0 0 2px var(--trek); }
.thumb-lg { width: 120px; height: 80px; }
.thumb-banner { width: 120px; height: 40px; }
.thumb-logo { object-fit: contain; background: #fff; padding: 3px; }
.thumb-wrap { display: inline-flex; align-items: center; gap: .6rem; }
.thumb-wrap .thumb-name { font-size: .78rem; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb-empty { flex-shrink: 0;
    width: 64px; height: 44px; border-radius: 6px; background: repeating-linear-gradient(45deg, #F5F6F8, #F5F6F8 6px, #EEF0F3 6px, #EEF0F3 12px);
    display: inline-flex; align-items: center; justify-content: center; color: var(--muted-2); font-size: 1rem;
}
.thumb-empty.thumb-banner { width: 120px; height: 40px; }
img.thumb.is-broken { cursor: default; object-fit: none; }

/* Grilla de imágenes (Marca/Modelo) */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.image-card {
    border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: var(--surface);
    transition: box-shadow .15s, border-color .15s; position: relative;
}
.image-card:hover { box-shadow: var(--shadow); border-color: var(--trek-100); }
.image-card img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; cursor: zoom-in; background: var(--line-2); display: block; }
.image-card .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-actions { margin-top: 8px; display: flex; justify-content: center; gap: 6px; }
.image-order { width: 72px; }

/* Propiedades / documentos */
.prop-row {
    display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border: 1px solid var(--line-2);
    border-radius: var(--radius-sm); margin-bottom: .5rem; background: var(--surface);
}
.prop-row:hover { border-color: var(--line); background: #FCFCFD; }
.prop-row .prop-name { font-weight: 600; min-width: 160px; color: var(--ink-2); }
.prop-row .prop-value { color: var(--ink); flex: 1; }
.doc-row .doc-name { font-weight: 600; }
.doc-actions .btn { margin-left: 4px; }
.doc-toolbar .form-select, .doc-toolbar .form-control { min-width: 200px; }
.banner-name, .imagenAnterior { font-size: .82rem; color: var(--muted); }

/* Visor de imágenes (lightbox) */
.lightbox {
    position: fixed; inset: 0; z-index: 2000; background: rgba(15, 15, 16, .92);
    display: none; align-items: center; justify-content: center; flex-direction: column; padding: 4rem 4.5rem 5rem;
    opacity: 0; transition: opacity .18s ease;
}
.lightbox.abierto { display: flex; opacity: 1; }
.lightbox img {
    max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5); background: #fff; user-select: none;
}
.lightbox .lb-caption { position: absolute; bottom: 1.25rem; left: 0; right: 0; text-align: center; color: #E5E7EB; font-size: .9rem; padding: 0 1rem; }
.lightbox .lb-caption small { color: #9CA3AF; margin-left: .5rem; }
.lightbox button {
    position: absolute; border: 0; background: rgba(255, 255, 255, .1); color: #fff;
    width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem; transition: background .15s;
}
.lightbox button:hover { background: var(--trek); }
.lightbox .lb-close { top: 1rem; right: 1rem; }
.lightbox .lb-open { top: 1rem; right: 4.25rem; font-size: 1.1rem; }
.lightbox .lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-spinner { position: absolute; color: #fff; }
@media (max-width: 575.98px) { .lightbox { padding: 4rem .75rem 5rem; } .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 3.5rem; transform: none; } }

/* ===== Dashboard =================================================== */
.hero {
    background: linear-gradient(120deg, var(--ink) 0%, #3b3233 55%, #5a3a24 100%);
    border-radius: var(--radius); color: #fff; padding: 1.75rem 2rem; position: relative; overflow: hidden; margin-bottom: 1.5rem;
}
.hero::after {
    content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 103, 2, .55) 0%, rgba(255, 103, 2, 0) 70%);
}
.hero h2 { font-size: 1.5rem; margin: 0 0 .35rem; color: #fff; }
.hero p { margin: 0; color: #D1D5DB; }
.hero .hero-pais { display: inline-flex; align-items: center; gap: .5rem; background: rgba(255, 255, 255, .1); padding: .3rem .75rem; border-radius: 999px; font-size: .85rem; margin-top: 1rem; }
.stat-card { display: flex; flex-direction: row; align-items: center; gap: 1rem; padding: 1.15rem 1.25rem; height: 100%; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--trek-100); color: inherit; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; background: var(--trek-50); color: var(--trek); flex-shrink: 0; }
.stat-value { font-size: 1.65rem; font-weight: 700; line-height: 1; font-family: "Montserrat", sans-serif; }
.stat-label { color: var(--muted); font-size: .85rem; margin-top: .3rem; }
.stat-card .bi-arrow-right { margin-left: auto; color: var(--muted-2); transition: transform .15s, color .15s; }
.stat-card:hover .bi-arrow-right { color: var(--trek); transform: translateX(3px); }
.quick-action { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-weight: 600; transition: all .15s; background: var(--surface); }
.quick-action i { color: var(--trek); font-size: 1.15rem; }
.quick-action:hover { border-color: var(--trek); background: var(--trek-50); color: var(--trek-700); }
.lista-reciente { list-style: none; margin: 0; padding: 0; }
.lista-reciente li { display: flex; align-items: center; gap: .85rem; padding: .7rem 0; border-bottom: 1px solid var(--line-2); }
.lista-reciente li:last-child { border-bottom: 0; }
.lista-reciente .titulo { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-reciente .meta { font-size: .78rem; color: var(--muted); }

/* ===== Login ======================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth-visual {
    position: relative; background: var(--ink) url("../img/brand/login-bg.jpg") center / cover no-repeat;
    display: flex; flex-direction: column; justify-content: flex-end; padding: 3rem; color: #fff;
}
.auth-visual::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(35, 31, 32, .25) 0%, rgba(35, 31, 32, .9) 100%); }
.auth-visual > * { position: relative; }
.auth-visual h2 { font-size: 2rem; color: #fff; max-width: 460px; }
.auth-visual h2 span { color: var(--trek); }
.auth-visual p { color: #D1D5DB; max-width: 440px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box .logo { height: 44px; margin-bottom: 2rem; }
.auth-box h1 { font-size: 1.5rem; margin-bottom: .35rem; }
.auth-box .sub { color: var(--muted); margin-bottom: 1.75rem; }
.auth-box .form-control, .auth-box .form-select { padding: .65rem .9rem; }
.auth-box .btn-trek { width: 100%; justify-content: center; padding: .7rem 1rem; font-size: 1rem; }
.pais-picker { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pais-picker input { display: none; }
.pais-picker label {
    display: flex; align-items: center; gap: .6rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
    cursor: pointer; font-weight: 600; transition: all .15s;
}
.pais-picker label:hover { border-color: var(--trek-100); }
.pais-picker input:checked + label { border-color: var(--trek); background: var(--trek-50); box-shadow: 0 0 0 1px var(--trek); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.input-icon > .form-control { padding-left: 2.5rem; }
.input-icon .toggle-pass { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); padding: .25rem .5rem; }
@media (max-width: 991.98px) { .auth { grid-template-columns: 1fr; } .auth-visual { display: none; } }

.centrado { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.25rem; color: var(--muted-2); display: block; margin-bottom: .5rem; }

/* Tarjetas anidadas heredadas de W3CRM (card > card-body > card): se aplanan */
.card .card { border: 0; box-shadow: none; background: transparent; }
.card .card > .card-body { padding: 0; }
.card-body > .row > .col-12 > .card.shadow-sm { box-shadow: none !important; }
.imagenAnterior { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.imagenAnterior .thumb-wrap .thumb-name { max-width: 160px; }
.form-select, .form-select-sm { padding-right: 2.1rem !important; }
div.dataTables_wrapper div.dataTables_length select { min-width: 72px; }
@media (max-width: 575.98px) {
    .page-header .acciones { margin-left: 0; width: 100%; }
    .page-header .acciones > * { flex: 1; justify-content: center; }
    div.dataTables_wrapper div.dataTables_filter input { width: 100%; margin-left: 0; }
}
