/* ==========================================================================
   Theme Modern — visual refresh for navbar, sidebar/menu, footer & panels
   Layered on top of the demo_1 admin theme; keeps all structural/JS classes
   intact and only restyles + improves responsive behaviour.
   ========================================================================== */

:root {
    --tm-red: #de060d;
    --tm-red-light: #ff5a3c;
    --tm-navy-900: #12142a;
    --tm-navy-800: #0f1b66;
    --tm-navy-700: #232748;
    --tm-navy-600: #2e3657;
    --tm-text-soft: rgba(255, 255, 255, 0.68);
    --tm-text-softer: rgba(255, 255, 255, 0.45);
    --tm-border-soft: rgba(255, 255, 255, 0.08);
}

/* ---------- Global polish ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar.default-layout {
    background: linear-gradient(115deg, var(--tm-navy-900) 0%, var(--tm-navy-800) 55%, #3a1220 100%) !important;
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--tm-border-soft);
}

.navbar.default-layout .navbar-brand-wrapper {
    background: #ffffff !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.12);
}

.navbar.default-layout .navbar-brand-wrapper .navbar-brand img {
    transition: transform 0.2s ease;
}

.navbar.default-layout .navbar-brand-wrapper .navbar-brand:hover img {
    transform: scale(1.04);
}

.navbar.default-layout .navbar-menu-wrapper .profile-text {
    font-weight: 500;
    letter-spacing: 0.2px;
}

.navbar.default-layout .navbar-menu-wrapper .btn-transparent {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.navbar.default-layout .navbar-menu-wrapper .btn-transparent:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.navbar.default-layout .navbar-menu-wrapper .btn-transparent .badge {
    position: relative;
    top: -12px;
    left: -6px;
    font-size: 10px;
    box-shadow: 0 0 0 2px var(--tm-navy-800);
}

.navbar.default-layout #UserDropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 16px;
    border-radius: 30px;
    transition: background 0.2s ease;
}

.navbar.default-layout #UserDropdown:hover {
    background: rgba(255, 255, 255, 0.08);
}

.navbar.default-layout #UserDropdown img.img-xs {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.navbar.default-layout .navbar-dropdown {
    border: none;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(18, 20, 42, 0.22);
    padding: 10px 0;
    margin-top: 12px;
    overflow: hidden;
    animation: tmDropdownIn 0.18s ease;
}

@keyframes tmDropdownIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar.default-layout .navbar-dropdown .dropdown-item {
    border-radius: 8px;
    margin: 2px 8px;
    width: auto;
    transition: background 0.15s ease, color 0.15s ease;
}

.navbar.default-layout .navbar-dropdown .dropdown-item:hover {
    background: rgba(222, 6, 13, 0.08);
    color: var(--tm-red);
}

.navbar.default-layout .navbar-dropdown .dropdown-item:hover i {
    color: var(--tm-red);
}

/* ==========================================================================
   Sidebar / menu
   ========================================================================== */
.sidebar {
    background: linear-gradient(180deg, var(--tm-navy-900) 0%, var(--tm-navy-800) 100%) !important;
    border-right: 1px solid var(--tm-border-soft);
}

.sidebar .sidebar-brand {
    padding: 22px 20px;
    color: #fff;
}

.sidebar .sidebar-brand-icon {
    color: var(--tm-red-light);
    margin-right: 8px;
}

.sidebar .sidebar-brand-text {
    font-weight: 600;
    letter-spacing: 0.3px;
}

.sidebar .sidebar-divider {
    border-top: 1px solid var(--tm-border-soft);
}

.sidebar .nav .nav-item .nav-link {
    color: var(--tm-text-soft) !important;
    border-left: 3px solid transparent;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.sidebar .nav .nav-item .nav-link .menu-icon {
    color: var(--tm-text-soft) !important;
    transition: color 0.18s ease;
    width: 22px;
    text-align: center;
}

.sidebar .nav .nav-item .nav-link:hover,
.sidebar .nav:not(.sub-menu)>.nav-item:hover:not(.nav-profile)>.nav-link {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
    border-left-color: var(--tm-red-light);
}

.sidebar .nav .nav-item .nav-link:hover .menu-icon {
    color: var(--tm-red-light) !important;
}

.sidebar .nav .nav-item .nav-link[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
    border-left-color: var(--tm-red);
}

.sidebar .nav .nav-item.active>.nav-link,
.sidebar .nav.sub-menu .nav-item .nav-link.active {
    color: #fff !important;
    border-left-color: var(--tm-red);
    background: rgba(222, 6, 13, 0.12) !important;
}

.sidebar .nav.sub-menu .nav-item .nav-link.active:before {
    background: var(--tm-red) !important;
}

.sidebar .nav .nav-item .collapse.show,
.sidebar .nav .nav-item .collapsing {
    background: rgba(0, 0, 0, 0.15) !important;
}

.sidebar .nav.sub-menu .nav-item .nav-link {
    color: var(--tm-text-softer) !important;
}

.sidebar .nav.sub-menu .nav-item .nav-link:hover {
    color: #fff !important;
}

.sidebar .nav.sub-menu .nav-item:hover>.nav-link:before {
    background: var(--tm-red-light) !important;
}

/* ==========================================================================
   Settings / documents side panel
   ========================================================================== */
.settings-panel {
    border-radius: 14px 0 0 14px;
    box-shadow: -10px 0 40px rgba(18, 20, 42, 0.18);
}

.settings-panel .settings-heading {
    color: var(--tm-navy-900);
    letter-spacing: 0.2px;
}

.settings-panel .settings-close {
    transition: color 0.15s ease, transform 0.15s ease;
}

.settings-panel .settings-close:hover {
    color: var(--tm-red);
    transform: rotate(90deg);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    position: relative;
    background: #f3f4fa;
    border-top: 1px solid rgba(18, 20, 42, 0.06);
}

.footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 140px;
    height: 3px;
    background: linear-gradient(90deg, var(--tm-red), var(--tm-red-light));
    border-radius: 0 3px 3px 0;
}

.footer a {
    color: var(--tm-red);
    font-weight: 500;
    transition: opacity 0.15s ease;
}

.footer a:hover {
    opacity: 0.75;
}

/* ==========================================================================
   Dashboard home — stat cards & quick access
   ========================================================================== */
.dashboard-home {
    padding-top: 4px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border-radius: 14px;
    padding: 22px 20px;
    box-shadow: 0 6px 20px rgba(18, 20, 42, 0.06);
    border-left: 4px solid var(--tm-navy-700);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(18, 20, 42, 0.1);
}

.stat-card-icon,
.stat-card .stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 12px;
    font-size: 20px;
    color: #fff;
    background: linear-gradient(135deg, var(--tm-navy-800), var(--tm-navy-700));
}

.stat-card-radicados { border-left-color: #128bfc; }
.stat-card-radicados .stat-icon { background: linear-gradient(135deg, #128bfc, #18bef1); }

.stat-card-estudio { border-left-color: #f4a100; }
.stat-card-estudio .stat-icon { background: linear-gradient(135deg, #f4a100, #ffc846); }

.stat-card-rechazados { border-left-color: var(--tm-red); }
.stat-card-rechazados .stat-icon { background: linear-gradient(135deg, var(--tm-red), var(--tm-red-light)); }

.stat-card-apoyo { border-left-color: #2ea86b; }
.stat-card-apoyo .stat-icon { background: linear-gradient(135deg, #2ea86b, #4fd18d); }

.stat-card-vencidos { border-left-color: #8a3ffc; }
.stat-card-vencidos .stat-icon { background: linear-gradient(135deg, #8a3ffc, #b07bff); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--tm-navy-900);
    line-height: 1.1;
}

.stat-label {
    font-size: 13px;
    color: #8891a5;
    margin-top: 4px;
}

.stat-sub {
    display: block;
    font-size: 12px;
    color: #8891a5;
    margin-top: 0px;
}

.stat-sub i {
    margin-right: 4px;
}

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

.stat-card-compact {
    gap: 10px;
    padding: 5px 14px;
    border-radius: 10px;
}

.stat-card-compact:hover {
    transform: none;
    box-shadow: 0 6px 20px rgba(18, 20, 42, 0.06);
}

.stat-card-compact .stat-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 9px;
    font-size: 14px;
}

.stat-card-compact .stat-value {
    font-size: 18px;
    line-height: 1.15;
}

.stat-card-compact .stat-label {
    font-size: 11px;
    margin-top: 0;
}

.stat-card-compact .stat-sub {
    display: block;
    font-size: 10.5px;
    color: #8891a5;
    margin-top: 3px;
}

.stat-card-compact .stat-sub i {
    margin-right: 3px;
}

.quick-access-panel {
    background: #ffffff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(18, 20, 42, 0.06);
}

.quick-access-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--tm-navy-900);
    margin-bottom: 18px;
    letter-spacing: 0.2px;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.quick-access-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 12px;
    border-radius: 12px;
    background: #f7f8fc;
    color: var(--tm-navy-800);
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.quick-access-item i {
    font-size: 22px;
    color: var(--tm-red);
    transition: color 0.18s ease;
}

.quick-access-item:hover {
    background: linear-gradient(135deg, var(--tm-red), var(--tm-red-light));
    color: #fff;
    transform: translateY(-2px);
    text-decoration: none;
}

.quick-access-item:hover i {
    color: #fff;
}

/* ==========================================================================
   Generic page header + form sections (parametros, entidad, etc.)
   ========================================================================== */
.page-header-block {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--tm-navy-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title i {
    color: var(--tm-red);
}

.page-subtitle {
    font-size: 13px;
    color: #8891a5;
    margin: 6px 0 0;
}

/* ==========================================================================
   Reusable button component — 2 tones by importance, plus a neutral/ghost
   variant for dismiss actions. Use on <a> or <button>.

   .btn-modern              base — always combine with a tone
   .btn-modern-primary       tone 1 — red, the single most important action
                              on a view (submit a form, create a record)
   .btn-modern-secondary     tone 2 — navy, flat, for frequent/lesser actions
                              (search, per-row actions, secondary navigation)
   .btn-modern-ghost         neutral/white — dismiss actions (Cancelar)
   .btn-modern-sm            size modifier for dense contexts (table rows)
   ========================================================================== */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-modern:hover {
    text-decoration: none;
}

.btn-modern-primary {
    background: linear-gradient(135deg, var(--tm-red), var(--tm-red-light));
    color: #fff;
    box-shadow: 0 6px 16px rgba(222, 6, 13, 0.25);
}

.btn-modern-primary:hover {
    filter: brightness(1.08);
    color: #fff;
}

.btn-modern-secondary {
    background: var(--tm-navy-800);
    color: #fff!important;
    box-shadow: 0 4px 12px rgba(18, 20, 42, 0.18);
}

.btn-modern-secondary:hover {
    background: var(--tm-navy-700);
    color: #fff;
    transform: translateY(-1px);
}

.btn-modern-ghost {
    background: #fff;
    color: var(--tm-navy-800);
    box-shadow: 0 4px 14px rgba(18, 20, 42, 0.08);
}

.btn-modern-ghost:hover {
    background: #eef0f7;
    color: var(--tm-navy-800);
}

.btn-modern-sm {
    padding: 6px 13px;
    border-radius: 8px;
    font-size: 12px;
    gap: 5px;
}

.btn-modern[disabled] {
    opacity: 0.4;
    pointer-events: none;
}

.btn-modern + .btn-modern {
    margin-left: 6px;
}

/* Entidad — profile-style cards */
.entidad-grid {
    display: grid;
    gap: 20px;
}

.entidad-profile-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(18, 20, 42, 0.06);
    overflow: hidden;
}

.entidad-profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
}

.entidad-logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 14px;
    background: #f7f8fc;
    border: 1px solid #eef0f7;
    font-size: 26px;
    color: #b6bccb;
    overflow: hidden;
}

.entidad-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.entidad-profile-info {
    flex: 1;
    min-width: 0;
}

.entidad-profile-info h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--tm-navy-900);
    margin: 0 0 8px;
}

.entidad-profile-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.entidad-url {
    font-size: 12.5px;
    color: #8891a5;
}

.entidad-url i {
    color: var(--tm-red);
    margin-right: 4px;
}

.tipo-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tipo-badge-catastro {
    background: rgba(18, 139, 252, 0.12);
    color: #128bfc;
}

.tipo-badge-transito {
    background: rgba(244, 161, 0, 0.14);
    color: #b97800;
}

.tipo-badge-general {
    background: rgba(46, 168, 107, 0.14);
    color: #2ea86b;
}

/* Role / status variants — same badge family, reused for users listing */
.tipo-badge-super {
    background: rgba(222, 6, 13, 0.12);
    color: var(--tm-red);
}

.tipo-badge-admin {
    background: rgba(18, 139, 252, 0.12);
    color: #128bfc;
}

.tipo-badge-user {
    background: rgba(18, 20, 42, 0.08);
    color: var(--tm-navy-800);
}

.tipo-badge-activo {
    background: rgba(46, 168, 107, 0.14);
    color: #2ea86b;
}

.tipo-badge-inactivo {
    background: rgba(18, 20, 42, 0.08);
    color: #8891a5;
}

.tipo-badge-pendiente {
    background: rgba(244, 161, 0, 0.14);
    color: #b97800;
}

.tipo-badge-resuelto {
    background: rgba(46, 168, 107, 0.14);
    color: #2ea86b;
}

.entidad-membrete-section {
    padding: 18px 22px 22px;
    border-top: 1px solid #eef0f7;
    background: #fbfcfe;
}

.entidad-membrete-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #8891a5;
    margin-bottom: 12px;
}

.entidad-membrete-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.membrete-box {
    border: 1px solid #eef0f7;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    text-align: center;
}

.membrete-box-title {
    display: block;
    font-size: 11px;
    color: #8891a5;
    margin-bottom: 8px;
}

.membrete-box img {
    max-width: 100%;
    max-height: 70px;
    object-fit: contain;
}

.membrete-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 70px;
    border: 1px dashed #dde1ee;
    border-radius: 8px;
    color: #b6bccb;
    font-size: 12px;
    font-style: italic;
}

.membrete-preview-btn {
    width: 100%;
    justify-content: center;
}

/* Sectioned forms */
.form-section-card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(18, 20, 42, 0.06);
    margin-bottom: 20px;
    overflow: hidden;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 22px;
    background: #f7f8fc;
    border-bottom: 1px solid #eef0f7;
    font-weight: 700;
    font-size: 14px;
    color: var(--tm-navy-900);
}

.form-section-header i {
    color: var(--tm-red);
}

.form-section-header-toggle {
    width: 100%;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.form-section-header-toggle .toggle-chevron {
    margin-left: auto;
    color: #8891a5 !important;
    transition: transform 0.2s ease;
}

.form-section-header-toggle[aria-expanded="true"] .toggle-chevron {
    transform: rotate(180deg);
}

.section-tag {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(18, 139, 252, 0.12);
    color: #128bfc;
}

.section-tag-action {
    margin-left: auto;
}

.editor-body {
    min-height: 320px;
    resize: vertical;
    font-family: "Courier New", monospace;
    font-size: 12.5px;
}

.editor-labels {
    min-height: 320px;
    border: 1px dashed #dde1ee;
    border-radius: 10px;
    padding: 10px;
    font-size: 12px;
    color: #b6bccb;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Buttons appended dynamically by editartipo*.js (label inserters) */
.editor-labels .btn {
    font-size: 11px;
    padding: 5px 8px;
    border-radius: 6px;
    text-align: left;
    white-space: normal;
    margin: 0 !important;
}

.form-subsection {
    padding: 20px 22px;
    border-bottom: 1px solid #eef0f7;
}

.form-subsection:last-child {
    border-bottom: none;
}

.form-subsection-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--tm-navy-900);
    margin-bottom: 16px;
}

.form-subsection-title i {
    color: var(--tm-red);
}

.form-section-card .form-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--tm-navy-800);
    margin-bottom: 6px;
}

.form-section-card .form-control,
.form-section-card .form-control-file {
    border-radius: 10px;
    border: 1px solid #e3e6f0;
    font-size: 13px;
}

.form-section-card .form-control:focus {
    border-color: var(--tm-red);
    box-shadow: 0 0 0 3px rgba(222, 6, 13, 0.12);
}

.detail-value {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--tm-navy-900);
    padding-top: 4px;
}

.link-action {
    font-weight: 600;
    font-size: 13px;
    color: var(--tm-navy-800);
    cursor: pointer;
    transition: color 0.15s ease;
}

.link-action:hover {
    color: var(--tm-red);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 11.5px;
    color: #8891a5;
}

.form-hint i {
    color: #2ea86b;
}

.upload-group .form-control-file {
    width: 100%;
}

.form-section-card .form-control-file {
    display: block;
    padding: 8px 10px;
    background: #fff;
    line-height: 1.4;
    cursor: pointer;
}

.form-section-card .form-control-file::file-selector-button {
    margin-right: 12px;
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    background: var(--tm-navy-800);
    color: #fff;
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease;
}

.form-section-card .form-control-file::file-selector-button:hover {
    background: var(--tm-navy-700);
}

.form-section-card .form-control-file:focus {
    outline: none;
    border-color: var(--tm-red);
    box-shadow: 0 0 0 3px rgba(222, 6, 13, 0.12);
}

.link-row .form-control {
    border-radius: 10px;
    border: 1px solid #e3e6f0;
    font-size: 13px;
}

.link-row .btn-modern {
    flex-shrink: 0;
}

/* Checkbox tree — permisos, mutaciones, y cualquier lista padre/hijo */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkbox-item {
    padding: 8px 4px;
}

.checkbox-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tm-navy-800);
    cursor: pointer;
    margin: 0;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--tm-red);
    cursor: pointer;
}

.checkbox-item-children {
    margin: 2px 0 10px 30px;
    padding-left: 14px;
    border-left: 2px solid #eef0f7;
}

.checkbox-item-children .checkbox-item label {
    font-weight: 400;
    font-size: 12.5px;
    color: #5a6376;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

/* ==========================================================================
   Generic data-table listing (tipooficio, tipodocumento, etc.)
   ========================================================================== */
.table-search-form label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--tm-navy-800);
    margin-bottom: 8px;
    display: block;
}

.table-search-row {
    display: flex;
    gap: 10px;
}

.table-search-row-center {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.table-search-row .form-control {
    border-radius: 10px;
    border: 1px solid #e3e6f0;
    font-size: 13px;
}

.table-search-row .form-control:focus {
    border-color: var(--tm-red);
    box-shadow: 0 0 0 3px rgba(222, 6, 13, 0.12);
}

.status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.status-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid #e3e6f0;
    background: #fff;
    color: var(--tm-navy-800);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.status-tab:hover {
    border-color: var(--tm-navy-700);
    color: var(--tm-navy-900);
    text-decoration: none;
}

.status-tab .status-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #f7f8fc;
    color: #8891a5;
    font-size: 11px;
    font-weight: 700;
}

.status-tab.active {
    border-color: var(--tm-red);
    background: rgba(222, 6, 13, 0.08);
    color: var(--tm-red);
}

.status-tab.active .status-tab-count {
    background: var(--tm-red);
    color: #fff;
}

.data-table-card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(18, 20, 42, 0.06);
    overflow: hidden;
}

.data-table thead th {
    background: #f7f8fc;
    color: #8891a5;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-top: none;
    border-bottom: 1px solid #eef0f7;
    white-space: nowrap;
}

.data-table td {
    vertical-align: middle;
    font-size: 13px;
    color: var(--tm-navy-800);
}

.table-inline-input {
    border-radius: 8px;
    border: 1px solid #e3e6f0;
    font-size: 12.5px;
    padding: 6px 10px;
    height: auto;
    min-width: 150px;
}

.table-inline-input:focus {
    border-color: var(--tm-red);
    box-shadow: 0 0 0 3px rgba(222, 6, 13, 0.12);
}

.row-index {
    color: #8891a5;
    font-size: 12px;
    margin-left: 4px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 0;
    color: #b6bccb;
    font-size: 13px;
    font-style: italic;
}

.empty-state i {
    font-size: 26px;
}

/* Modernized Bootstrap modal */
.modern-modal {
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

.modern-modal .modal-header {
    background: linear-gradient(115deg, var(--tm-navy-900) 0%, var(--tm-navy-800) 55%, #3a1220 100%);
    color: #fff;
    border-bottom: none;
    padding: 18px 22px;
}

.modern-modal .modal-header .modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
}

.modern-modal .modal-header .close {
    color: #fff;
    text-shadow: none;
    opacity: 0.8;
}

.modern-modal .modal-header .close:hover {
    opacity: 1;
}

.modern-modal .modal-body {
    padding: 22px;
}

.modern-modal .form-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--tm-navy-800);
}

.modern-modal .form-control {
    border-radius: 10px;
    border: 1px solid #e3e6f0;
    font-size: 13px;
}

.modern-modal .form-control:focus {
    border-color: var(--tm-red);
    box-shadow: 0 0 0 3px rgba(222, 6, 13, 0.12);
}

.modern-modal .modal-footer {
    border-top: 1px solid #eef0f7;
    padding: 16px 22px;
}

/* ==========================================================================
   Pagination — global override for every ->links() call in the app
   ========================================================================== */
.pagination {
    margin: 0;
    flex-wrap: wrap;
}

.pagination .page-item .page-link {
    border: none;
    color: var(--tm-navy-800);
    font-size: 12.5px;
    margin: 0 3px;
    border-radius: 8px !important;
    padding: 7px 12px;
}

.pagination .page-item .page-link:hover {
    background: #eef0f7;
    color: var(--tm-navy-800);
}

.pagination .page-item.active .page-link {
    background: var(--tm-red);
    color: #fff;
    box-shadow: 0 4px 10px rgba(222, 6, 13, 0.25);
}

.pagination .page-item.disabled .page-link {
    color: #c3c8d6;
    background: transparent;
}

/* ==========================================================================
   Stepper / línea de tiempo de rastreo (pqrs.consulta, pqrs.favoritos)
   ========================================================================== */
.stepper-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 4px;
    margin: 12px 0 20px;
}

.stepper-item {
    position: relative;
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding-top: 4px;
}

.stepper-item:not(:last-child)::after {
    content: '';
    position: absolute;
    z-index: 0;
    top: 28px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: #e3e6f0;
}

.stepper-item.completed:not(:last-child)::after {
    background: var(--tm-navy-700);
}

.stepper-item.completed.ok:not(:last-child)::after {
    background: #2ea86b;
}

.stepper-item .step-counter {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: #c3c8d6;
    font-size: 16px;
}

.stepper-item.completed .step-counter {
    background: var(--tm-navy-700);
}

.stepper-item.completed.ok .step-counter {
    background: #2ea86b;
}

.stepper-item .step-name {
    font-size: 12px;
    color: var(--tm-navy-800);
    line-height: 1.35;
}

.stepper-item .step-name b {
    display: block;
    font-size: 12.5px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991px) {
    .navbar.default-layout .navbar-menu-wrapper .profile-text.gestor-label {
        display: none;
    }

    .sidebar.sidebar-offcanvas {
        max-width: 85vw;
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35);
    }

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

    .stepper-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .stepper-item {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
        min-width: 0;
    }

    .stepper-item .step-counter {
        margin: 0;
    }

    .stepper-item:not(:last-child)::after {
        top: 0;
        left: 23px;
        width: 3px;
        height: 100%;
    }
}

@media (max-width: 767px) {
    .navbar.default-layout .navbar-brand-wrapper {
        width: 140px;
    }

    .navbar.default-layout .navbar-menu-wrapper {
        padding-left: 8px;
        padding-right: 8px;
    }

    .navbar.default-layout #UserDropdown .welcome-name {
        display: none;
    }

    .navbar.default-layout .navbar-menu-wrapper .btn-transparent {
        width: 36px;
        height: 36px;
    }

    .footer .container-fluid {
        text-align: center;
    }

    .footer .float-none.float-sm-right {
        margin-top: 6px;
    }

    .quick-access-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .page-header-block {
        flex-direction: column;
    }

    .form-section-header {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .section-tag,
    .section-tag-action {
        margin-left: 0;
    }

    .form-actions {
        justify-content: stretch;
    }

    .form-actions .btn-modern {
        flex: 1;
    }

    .entidad-profile-header {
        flex-wrap: wrap;
    }

    .entidad-profile-header .btn-modern {
        width: 100%;
    }

    .entidad-membrete-preview {
        grid-template-columns: 1fr;
    }

    .checkbox-item-children {
        margin-left: 14px;
        padding-left: 10px;
    }

    .table-search-row {
        flex-wrap: wrap;
    }

    .table-search-row .form-control {
        flex: 1 1 100%;
    }

    .status-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .status-tab {
        flex: 0 0 auto;
    }

    .table-inline-input {
        min-width: 130px;
    }
}

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

@media (max-width: 420px) {
    .sidebar.sidebar-offcanvas {
        max-width: 92vw;
    }

    .navbar.default-layout .navbar-brand-wrapper {
        width: 110px;
    }
}
