/* ==========================================================================
   AMPLYA CRM / ayCloud — Modern SaaS UI Theme (v2.4 — Corporate Orange Edition)
   Compatible 100% con Bootstrap 3.3.7, DataTables, Datepicker y vistas Blade
   ========================================================================== */

:root {
    --bg-body: #faf8f6;
    --bg-surface: #ffffff;
    --bg-subtle: #fcfaf8;
    --border-color: #e7e5e4;
    --border-strong: #d6d3d1;

    --brand-navy: #1c1917;
    --brand-dark: #9a3412;
    --brand-primary: #ea580c;
    --brand-primary-hover: #c2410c;
    --brand-light: #f97316;
    --brand-amber: #fb923c;

    --brand-gradient: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #f97316 100%);
    --brand-gradient-hover: linear-gradient(135deg, #9a3412 0%, #c2410c 50%, #ea580c 100%);
    --brand-hero-gradient: linear-gradient(135deg, #7c2d12 0%, #c2410c 42%, #ea580c 76%, #fb923c 100%);

    --brand-tint-50: #fff7ed;
    --brand-tint-100: #ffedd5;
    --brand-tint-200: #fed7aa;
    --brand-tint-300: #fdba74;

    --danger: #be123c;
    --danger-hover: #9f1239;
    --success: #16a34a;

    --text-main: #1c1917;
    --text-secondary: #44403c;
    --text-muted: #78716c;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-md: 0 4px 16px rgba(28, 25, 23, 0.06), 0 2px 4px rgba(28, 25, 23, 0.04);
    --shadow-lg: 0 12px 32px rgba(28, 25, 23, 0.12);
}

/* BASE & TYPOGRAPHY **********************************************************/

html, body {
    height: 100%;
}

body {
    background-color: var(--bg-body);
    color: var(--text-secondary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-main-content {
    flex: 1 0 auto;
    padding-bottom: 24px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    font-weight: 600;
}

a {
    color: var(--brand-primary);
    transition: color 0.15s ease, background-color 0.15s ease;
}

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

ul {
    padding: 0;
}

/* TOP BRAND HEADER (Solo visible en Login / Selección BD / Claves Ajenas) ***/

body:has(#main-menu) header.top-brand-bar {
    display: none;
}

header.top-brand-bar {
    background-color: var(--bg-surface);
    border-bottom: 2px solid var(--brand-tint-200);
    box-shadow: var(--shadow-sm);
    padding: 12px 0;
    margin-bottom: 16px;
}

header .container {
    border-bottom: none;
    padding-bottom: 0;
}

.brand-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

#header-left {
    float: none;
    display: flex;
    align-items: center;
}

#header-left img {
    max-height: 44px;
    width: auto;
    display: block;
}

#header-right {
    float: none;
    padding-top: 0;
    display: flex;
    align-items: center;
}

.header-session-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.session-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background-color: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.session-pill-accent {
    background-color: var(--brand-tint-50);
    color: var(--brand-primary);
    border-color: var(--brand-tint-200);
}

/* UNIFIED HEADER + NAVBAR (MAIN MENU & SUBMENU) ******************************/

.collapsing {
    display: none;
}

.unified-topbar {
    background-color: var(--bg-surface);
    border-top: 3px solid var(--brand-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1020;
    margin-bottom: 0;
}

/* Cuando existe submenú debajo, ambas barras se funden en un único bloque limpio */
body:has(.unified-subbar) .unified-topbar {
    box-shadow: none;
    border-bottom: 1px solid #f0ece8;
}

.unified-navbar.navbar-default {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    min-height: 60px;
    margin-bottom: 0;
    border-radius: 0;
}

.unified-navbar > .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.unified-brand.navbar-brand {
    height: 60px;
    padding: 11px 18px 11px 0;
    margin-right: 10px;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border-color);
}

.unified-brand.navbar-brand img {
    max-height: 33px;
    width: auto;
    display: block;
}

#main-menu {
    padding: 0;
}

.unified-navbar .navbar-nav > li {
    background-color: transparent !important;
    padding: 10px 2px;
}

.unified-navbar .navbar-nav > li > a {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 13.5px;
    padding: 9px 11px;
    border-radius: 8px;
    line-height: 20px;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.unified-navbar .navbar-nav > li:hover > a,
.unified-navbar .navbar-nav > li > a:hover,
.unified-navbar .navbar-nav > li > a:focus {
    background-color: var(--brand-tint-50) !important;
    color: var(--brand-primary) !important;
}

#main-menu .navbar-left > .active > a,
.unified-navbar .navbar-nav > .active > a,
.unified-navbar .navbar-nav > .active > a:hover,
.unified-navbar .navbar-nav > .active > a:focus {
    color: var(--brand-primary) !important;
    background-color: var(--brand-tint-50) !important;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--brand-primary);
    border-radius: 8px 8px 3px 3px;
}

/* Elementos de utilidad a la derecha de la cabecera unificada */
.unified-nav-right > li > a.nav-icon-only {
    color: var(--text-muted) !important;
    padding: 9px 9px;
}

.unified-nav-right > li > a.nav-badge-pill {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%) !important;
    color: var(--brand-dark) !important;
    border: 1px solid var(--brand-tint-200);
    font-size: 12px;
    font-weight: 600;
    padding: 7px 11px;
    margin-left: 4px;
}

.unified-nav-right > li > a.nav-badge-pill:hover {
    background: var(--brand-tint-100) !important;
    border-color: var(--brand-tint-300);
}

.unified-nav-right > li > a.nav-user-pill {
    background-color: var(--bg-subtle) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color);
    font-size: 12.5px;
    font-weight: 500;
    padding: 7px 11px;
    margin-left: 4px;
}

.unified-nav-right > li > a.nav-logout-btn {
    color: var(--danger) !important;
    font-weight: 600;
    padding: 8px 11px;
    margin-left: 4px;
}

.unified-nav-right > li > a.nav-logout-btn:hover {
    background-color: #fff1f2 !important;
    color: var(--danger-hover) !important;
}

.unified-navbar .navbar-toggle {
    border-color: var(--border-strong);
    margin-top: 13px;
}

.unified-navbar .navbar-toggle .icon-bar {
    background-color: var(--text-main);
}

/* Subbarra secundaria integrada (Segundo nivel elegante en tonos cálidos) */
.unified-subbar {
    background: linear-gradient(90deg, rgba(255, 247, 237, 0.95) 0%, rgba(252, 250, 248, 0.96) 100%);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--brand-tint-200);
    box-shadow: 0 3px 10px rgba(154, 52, 18, 0.05);
    position: sticky;
    top: 63px;
    z-index: 1018;
    margin-bottom: 18px;
}

#submenu.navbar-default {
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    margin: 0;
    padding: 6px 0;
    min-height: 42px;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* Evita pseudo-elementos clearfix de Bootstrap 3 que descuadran flexbox */
#submenu.navbar-default:before,
#submenu.navbar-default:after,
#submenu .navbar-nav:before,
#submenu .navbar-nav:after {
    display: none !important;
}

.subbar-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-primary);
    padding: 4px 12px 4px 2px;
    margin-right: 6px;
    border-right: 1px solid var(--brand-tint-200);
    white-space: nowrap;
}

.subbar-label .glyphicon {
    font-size: 12px;
    opacity: 0.9;
}

.subbar-divider {
    width: 1px;
    height: 18px;
    background-color: var(--brand-tint-200);
    margin: 0 6px;
    display: inline-block;
}

#submenu .navbar-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    margin: 0;
    float: none;
}

#submenu.navbar-default li {
    background-color: transparent !important;
    margin: 0;
    float: none;
}

#submenu.navbar-default .navbar-nav > li > a {
    color: var(--text-secondary) !important;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

#submenu.navbar-default li:hover > a,
#submenu.navbar-default .navbar-nav > li > a:hover {
    background-color: #ffffff !important;
    color: var(--brand-primary) !important;
    border-color: var(--brand-tint-200);
}

#submenu .active > a,
#submenu.navbar-default .navbar-nav > .active > a,
#submenu.navbar-default .navbar-nav > .active > a:hover,
#submenu.navbar-default .navbar-nav > .active > a:focus {
    color: #ffffff !important;
    background: var(--brand-gradient) !important;
    border: 1px solid var(--brand-primary) !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.22);
}

/* PAGE HEADERS & TABS ********************************************************/

.page-title {
    background-color: var(--bg-surface);
    color: var(--text-main);
    font-size: 18px;
    font-weight: 600;
    margin: 14px 0 4px;
    padding: 14px 20px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-title .glyphicon {
    font-size: 13px;
    color: var(--brand-primary);
}

#tabs {
    clear: both;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    overflow: hidden;
}

#tabs.nav-tabs li {
    background-color: var(--bg-subtle) !important;
}

#tabs.nav-tabs > li > a {
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    color: var(--text-muted);
    padding: 12px 16px;
    margin: 0;
    transition: all 0.15s ease;
}

#tabs.nav-tabs > li > a:hover {
    background-color: var(--brand-tint-50) !important;
    color: var(--brand-primary);
}

.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:focus,
.nav-tabs.nav-justified > .active > a:hover,
#tabs.nav-tabs > li.active > a {
    background-color: var(--bg-surface) !important;
    border-bottom: 3px solid var(--brand-primary) !important;
    color: var(--brand-primary) !important;
    font-weight: 600;
}

.titulo-pestanya {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin: 2px 0;
    color: inherit;
}

.tab-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-md);
    padding-bottom: 16px;
}

.tab-content h2 {
    font-size: 16px;
}

.contenido-pestanya {
    padding: 20px 24px;
}

.section-banner {
    background: var(--brand-gradient);
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.2);
}

/* ACTION TOOLBAR & BUTTONS ***************************************************/

.buttons-area {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    clear: both;
    margin: 18px 20px;
    padding: 12px 16px;
}

button {
    box-sizing: border-box;
}

button:focus {
    outline: none;
}

.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13.5px;
    transition: all 0.16s ease;
}

.btn-primary {
    background: var(--brand-gradient) !important;
    border-color: var(--brand-primary) !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--brand-gradient-hover) !important;
    border-color: var(--brand-primary-hover) !important;
    color: #ffffff !important;
}

.btn-custom {
    border: 1px solid transparent;
    border-radius: 8px;
    color: #ffffff;
    float: right;
    margin-left: 8px;
    padding: 8px 16px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.08);
}

.btn-custom-blue {
    background: var(--brand-gradient);
    border-color: var(--brand-primary);
}

.btn-custom-blue:hover,
.btn-custom-blue:focus {
    background: var(--brand-gradient-hover) !important;
    border-color: var(--brand-primary-hover) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.28);
}

.btn-custom-red {
    background: linear-gradient(135deg, #9f1239 0%, #e11d48 100%);
    border-color: var(--danger);
}

.btn-custom-red:hover,
.btn-custom-red:focus {
    background: linear-gradient(135deg, #881337 0%, #be123c 100%) !important;
    border-color: var(--danger-hover) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(190, 18, 60, 0.25);
}

.btn-custom-white {
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--brand-tint-200);
    border-radius: 999px;
    padding: 4px 12px;
    margin: 3px 4px;
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.btn-custom-white:hover,
.btn-custom-white:focus {
    background-color: var(--brand-tint-100);
    border-color: var(--brand-tint-300);
    color: var(--brand-dark);
}

.custom-close {
    float: left;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--brand-primary);
    opacity: 0.85;
    padding-right: 6px;
}

.destacado {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    background: var(--brand-tint-50);
    border: 1px solid var(--brand-tint-200);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.ayuda-formulario,
.ayuda-formulario:link,
.ayuda-formulario:visited {
    float: left;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    margin-left: 0;
    box-shadow: var(--shadow-sm);
}

.ayuda-formulario:hover {
    background-color: var(--brand-tint-50) !important;
    border-color: var(--brand-tint-200) !important;
    color: var(--brand-primary) !important;
    transform: none;
}

/* FORMS & INPUTS *************************************************************/

.entity-form-left,
.entity-form-right {
    padding: 20px 24px 20px 32px;
}

.entity-form-left label,
.entity-form-right label,
form label {
    display: block;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
}

.entity-form-left .form-control,
.entity-form-right .form-control {
    display: inline-block;
    width: 70%;
    vertical-align: middle;
}

.form-group {
    margin-bottom: 16px;
}

.form-control {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.03);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    height: 38px;
    padding: 7px 12px;
    text-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-control:hover {
    background-color: var(--bg-surface);
    border-color: var(--brand-amber);
}

.form-control:focus {
    background-color: var(--bg-surface);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.16);
    outline: none;
}

.form-control option:hover {
    color: #ffffff !important;
    background: var(--brand-primary) !important;
}

textarea,
textarea.form-control {
    resize: vertical;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-surface);
}

textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.16);
    outline: none;
}

[readonly='readonly'],
.form-control[readonly] {
    background-color: #f5f3f0;
    color: #57534e;
    border-color: var(--border-color);
    pointer-events: none;
}

/* Excepción: los filtros de fecha mantienen interactividad */
.filtro-fecha {
    pointer-events: auto !important;
}

input {
    width: 100%;
}

input[type="radio"],
input[type="checkbox"] {
    width: auto;
    min-width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 6px;
    accent-color: var(--brand-primary);
}

.input-box {
    border: 1px solid var(--border-color);
    background-color: var(--bg-subtle);
    border-radius: 8px;
    height: 38px;
    line-height: 36px;
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    width: 70%;
}

.input-box:hover {
    background-color: var(--brand-tint-50);
    border-color: var(--brand-tint-300);
}

.input-box legend {
    font-size: 13px;
    border: none;
    margin: 0;
}

.in-form-btn {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    height: 36px;
    min-width: 34px;
    padding: 4px 9px;
    vertical-align: middle;
    margin-left: 2px;
    transition: all 0.15s ease;
}

.in-form-btn:hover,
.in-form-btn:focus {
    background: var(--brand-gradient);
    border-color: var(--brand-primary);
    color: #ffffff;
}

.label-checkbox {
    display: inline !important;
}

.calendario {
    padding-left: 0;
}

.asterisco {
    font-size: 100%;
    color: var(--brand-primary);
    font-weight: 700;
}

.col-centered {
    float: none;
    margin: 0 auto;
}

/* AUTHENTICATION CARDS (LOGIN / SELECT BD / RECUPERAR PASS) ******************/

.auth-wrapper {
    max-width: 440px;
    margin: 28px auto 40px;
    padding: 0 15px;
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--brand-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px 32px 28px;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--brand-gradient);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
    box-shadow: 0 6px 14px rgba(234, 88, 12, 0.26);
}

.auth-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px;
}

.auth-card-subtitle {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 0;
}

.auth-card .form-horizontal .form-group {
    margin-left: 0;
    margin-right: 0;
}

.auth-card .form-control {
    width: 100% !important;
    height: 42px;
}

.auth-card .btn-auth-submit {
    width: 100%;
    float: none;
    margin-left: 0;
    height: 42px;
    font-size: 14.5px;
    font-weight: 600;
}

.auth-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--brand-tint-50);
    border: 1px solid var(--brand-tint-200);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13.5px;
}

.auth-meta-row strong {
    color: var(--brand-dark);
}

/* DASHBOARD INICIO (/inicio) *************************************************/

.dashboard-hero {
    background: var(--brand-hero-gradient);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin: 18px 0 24px;
    box-shadow: 0 8px 24px rgba(194, 65, 12, 0.22);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-hero h2 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
}

.dashboard-hero p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 14px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.module-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.1);
    border-color: var(--brand-tint-300);
}

.module-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.module-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid var(--brand-tint-200);
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.module-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.module-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.module-chip {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.module-chip:hover {
    background: var(--brand-gradient);
    border-color: var(--brand-primary);
    color: #ffffff;
}

/* TABLES, DATAGRIDS & SEARCH LISTS *******************************************/

td, th {
    padding: 10px 12px;
}

.tabla_busqueda {
    width: 100%;
    margin: 12px auto;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.list td,
.list-header th {
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.list tr {
    background-color: var(--bg-surface);
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.list tr:nth-child(even) {
    background-color: var(--bg-subtle);
}

.list tr:hover,
.list tr.highlighted-li {
    background-color: var(--brand-tint-100) !important;
}

.fake-tabindex,
.fake-tabindex:hover,
.fake-tabindex-grid,
.fake-tabindex-grid:hover {
    color: var(--brand-primary);
    font-weight: 600;
    text-decoration: none;
}

.sort {
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #ffffff;
    text-decoration: none;
    background: var(--brand-gradient);
    height: 38px;
    cursor: pointer;
}

.sort:hover {
    text-decoration: none;
    background: var(--brand-gradient-hover);
}

.sort:focus {
    outline: none;
}

.sort.asc:after {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #fff;
    content: "";
    position: relative;
    top: 4px;
    right: -5px;
}

.sort.desc:after {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #fff;
    content: "";
    position: relative;
    top: -4px;
    right: -5px;
}

.datagrid,
table.dataTable {
    width: 100% !important;
    border-spacing: 0 !important;
    border-collapse: collapse !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-surface);
}

.datagrid thead th,
table.dataTable thead th {
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
    color: var(--brand-dark);
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--brand-tint-300) !important;
    padding: 11px 12px;
}

.datagrid tbody td,
table.dataTable tbody td {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 12px;
}

.datagrid tbody tr:hover,
table.dataTable tbody tr:hover {
    background-color: var(--brand-tint-50) !important;
}

/* Pagination */
.pagination {
    margin: 16px 0 4px;
}

.pagination li {
    border-bottom: inherit;
    padding: 0;
}

.pagination > li > a,
.pagination > li > span {
    border-radius: 6px !important;
    margin: 0 2px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
}

.pagination > li > a:hover {
    background-color: var(--brand-tint-50);
    border-color: var(--brand-tint-200);
    color: var(--brand-primary);
}

.pagination > .active > a,
.pagination > .active > a:hover,
.pagination > .active > span {
    background: var(--brand-gradient);
    border-color: var(--brand-primary);
    color: #ffffff;
}

.pagination > .disabled > a {
    color: var(--text-muted);
}

/* MODALS & DATEPICKER ********************************************************/

.modal-dialog {
    width: 94%;
    max-width: 860px;
    margin: 32px auto;
}

#filterModal .modal-dialog {
    max-width: 480px;
}

.modal-content {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--brand-primary);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(90deg, #fff7ed 0%, #ffffff 100%);
    border-bottom: 1px solid var(--brand-tint-200);
    padding: 16px 22px;
}

.modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    background-color: var(--bg-subtle);
    border-top: 1px solid var(--border-color);
    padding: 14px 22px;
}

/* Datepicker flotante moderno en naranja */
.datepicker-dropdown {
    border-radius: var(--radius-md);
    border: 1px solid var(--brand-tint-200);
    box-shadow: var(--shadow-lg);
    padding: 10px;
    font-family: 'Inter', sans-serif;
}

.datepicker table tr td.active.active,
.datepicker table tr td.active:hover.active,
.datepicker table tr td span.active.active {
    background: var(--brand-gradient) !important;
    background-color: var(--brand-primary) !important;
    background-image: none !important;
    border-color: var(--brand-primary) !important;
    color: #ffffff !important;
}

.datepicker table tr td.today {
    background-color: var(--brand-tint-100) !important;
    background-image: none !important;
    color: var(--brand-dark) !important;
    font-weight: 600;
}

.datepicker table tr td.day:hover,
.datepicker table tr td span:hover {
    background-color: var(--brand-tint-50) !important;
    color: var(--brand-primary) !important;
}

/* ALERTS & TOOLTIPS **********************************************************/

.alert {
    border-radius: var(--radius-md);
    border-width: 1px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    margin: 12px 20px;
}

.auth-card .alert {
    margin: 0 0 16px;
}

.tooltip.top .tooltip-arrow {
    border-top-color: var(--brand-navy);
}

.tooltip.bottom .tooltip-arrow {
    border-bottom-color: var(--brand-navy);
}

.tooltip-inner {
    background-color: var(--brand-navy);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
}

/* MISC LEGACY HELPERS ********************************************************/

#titulo-aplicacion {
    font-size: 12px;
    float: right;
    text-align: center;
}

.option {
    color: var(--brand-primary) !important;
    background-color: var(--brand-primary) !important;
}

.documentacion input[type="file"],
.documentacion2 input[type="file"] {
    display: none;
}

.documentacion2 {
    width: 150px;
    display: inline-block !important;
}

.documentacion {
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--bg-subtle);
    display: inline-block;
    padding: 6px 12px;
    cursor: pointer;
}

.parametros-campos label {
    display: inline-block;
    width: 25%;
}

.parametros-campos input {
    width: 49% !important;
    box-sizing: border-box;
}

#info {
    text-align: center;
}

.h3-conexcontable {
    font-size: 16px;
    padding: 10px 0;
}

.hr-ayuda {
    width: 130px;
    margin-left: 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}

/* FOOTER *********************************************************************/

footer.app-footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    padding: 14px 0;
    color: var(--text-muted);
    font-size: 12.5px;
}

.app-footer-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.footer-col-left {
    justify-self: start;
    white-space: nowrap;
}

.footer-col-center {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.footer-col-center a {
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-col-center a:hover {
    color: var(--brand-primary);
}

.footer-dot {
    color: var(--border-strong);
}

.footer-col-right {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.footer-gsbase-logo {
    height: 22px;
    width: auto;
    opacity: 0.9;
}

/* MEDIA QUERIES **************************************************************/

@media (max-width: 767px) {
    .app-footer-bar {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 8px;
    }

    .footer-col-left,
    .footer-col-center,
    .footer-col-right {
        justify-self: center;
    }

    .entity-form-left,
    .entity-form-right {
        padding: 16px;
    }

    .entity-form-left .form-control,
    .entity-form-right .form-control {
        width: 100%;
        margin-bottom: 6px;
    }

    .buttons-area .btn-custom {
        float: none;
        display: inline-block;
        margin: 4px 4px 4px 0;
    }
}

@media (min-width: 768px) {
    #desktop-menu {
        display: block;
    }

    #small-devices-menu {
        display: none;
    }
}

@media (min-width: 1200px) {
    .container {
        width: 92%;
        max-width: 1440px;
    }
}
