/* ==========================================================================
   SISTEMA DE SOPORTE & GESTIÓN DE REQUERIMIENTOS TI
   Estilo Base: Metálico, Vidrio Glassmorphism y Acabados Tridimensionales
   ========================================================================== */

:root {
    --font-main: Arial, Helvetica, sans-serif;
    --font-mono: Arial, 'Courier New', monospace;

    /* Tema Base: Titanio Oscuro */
    --bg-base: #0b0f17;
    --bg-surface: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --bg-modal: #0f172a;
    --bg-input: rgba(15, 23, 42, 0.85);

    --border-color: rgba(255, 255, 255, 0.1);
    --border-bright: rgba(255, 255, 255, 0.22);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --accent-glow: rgba(56, 189, 248, 0.35);

    --primary-grad: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    --success-grad: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    --warning-grad: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    --danger-grad: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --purple-grad: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);

    --shadow-metallic: 0 10px 30px -5px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.1) inset;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
}

body, button, input, select, textarea, table, th, td, span, div, h1, h2, h3, h4, h5, h6, a, label {
    font-family: Arial, Helvetica, sans-serif !important;
}

body {
    font-family: Arial, Helvetica, sans-serif !important;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    padding: 24px 20px;
    background-attachment: fixed;
}

.app-container {
    max-width: 1380px;
    margin: 0 auto;
}

/* ==========================================================================
   BARRA SUPERIOR (HEADER)
   ========================================================================== */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-xl);
    padding: 16px 28px;
    box-shadow: var(--shadow-metallic);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    margin-bottom: 28px;
    position: relative;
    z-index: 1000;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: var(--primary-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    box-shadow: 0 4px 14px var(--accent-glow);
    border: 1px solid var(--border-bright);
}

.brand-titles h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
    margin: 0;
}

.brand-titles p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

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

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

.nav-item.active {
    color: var(--accent);
    background: rgba(56, 189, 248, 0.12);
    border-color: var(--accent);
    font-weight: 700;
}

.nav-badge-pill {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 4px;
}

.ticket-count-badge {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ==========================================================================
   CHIP DE SESIÓN DE USUARIO Y BOTÓN DE LOGOUT MEJORADO
   ========================================================================== */
.user-session-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-bright);
    border-radius: 24px;
    padding: 4px 6px 4px 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-normal);
}

.user-session-chip:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.user-avatar-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.user-session-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.user-session-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-session-role {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(185, 28, 28, 0.35) 100%);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.5);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);
}

.btn-logout:active {
    transform: translateY(1px);
}

/* ==========================================================================
   BOTONES Y ACCIONES
   ========================================================================== */
.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-portal-role {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary-grad);
    color: #ffffff;
    border-color: var(--border-bright);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.6);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-bright);
}

.btn-success {
    background: var(--success-grad);
    color: #ffffff;
    border-color: #22c55e;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.6);
}

.btn-danger {
    background: var(--danger-grad);
    color: #ffffff;
    border-color: #ef4444;
}

/* ==========================================================================
   DROPDOWN MENUS DE PERFIL (DISEÑO PREMIUM, HOMOGÉNEO & EN LÍNEA)
   ========================================================================== */
.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    position: relative;
    z-index: 2000;
}

.dropdown-menu-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 1002;
}

.btn-portal-role {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 18px;
    border-radius: 24px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    user-select: none;
    position: relative;
    white-space: nowrap;
}

.btn-role-gestion {
    background: linear-gradient(135deg, #d97706 0%, #b45309 50%, #92400e 100%);
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    border-color: rgba(245, 158, 11, 0.6);
}

.btn-role-gestion:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    filter: brightness(1.12);
}

.btn-role-admin {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #3730a3 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    border-color: rgba(129, 140, 248, 0.6);
}

.btn-role-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    filter: brightness(1.12);
}

.dropdown-menu-container.open .btn-role-gestion,
.dropdown-menu-container.open .btn-role-admin {
    transform: translateY(0);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2), inset 0 2px 4px rgba(0,0,0,0.3);
}

.dropdown-menu-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    min-width: 300px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 1px 1px rgba(255, 255, 255, 0.12) inset;
    z-index: 5000;
    padding: 8px 6px;
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
}

/* Puente invisible para que el cursor no pierda el hover al bajar desde el botón */
.dropdown-menu-content::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 16px;
    background: transparent;
}

.dropdown-menu-container.authenticated:hover .dropdown-menu-content,
.dropdown-menu-container.authenticated:focus-within .dropdown-menu-content,
.dropdown-menu-container.open .dropdown-menu-content,
.dropdown-menu-container.active .dropdown-menu-content {
    display: block;
    animation: fadeInDrop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDrop {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-group-header {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 8px 12px 4px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-item-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    margin: 1px 0;
}

.dropdown-item-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--accent);
    transform: translateX(4px);
}

.dropdown-item-btn:active {
    transform: translateX(2px) scale(0.99);
}

.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.12) 30%, rgba(255, 255, 255, 0.12) 70%, transparent 100%);
    margin: 6px 0;
}

/* ==========================================================================
   TABLAS Y TARJETAS
   ========================================================================== */
.table-container, .portal-entry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-metallic);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.table-header-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tickets-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.tickets-table th {
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.tickets-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.88rem;
    vertical-align: middle;
}

.tickets-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   INSIGNIAS DE ESTADO (BADGES)
   ========================================================================== */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.badge-status.abierto {
    background: rgba(2, 132, 199, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(2, 132, 199, 0.4);
}
.badge-status.abierto .status-dot { background: #38bdf8; box-shadow: 0 0 6px #38bdf8; }

.badge-status.en-proceso {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.badge-status.en-proceso .status-dot { background: #f59e0b; }

.badge-status.cerrado {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}
.badge-status.cerrado .status-dot { background: #22c55e; }

/* ==========================================================================
   FORMULARIOS
   ========================================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-label .required {
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.92rem;
    transition: var(--transition-fast);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) inset;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ==========================================================================
   MODALES (VENTANAS SUPERPUESTAS)
   ========================================================================== */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1050;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.active {
    display: flex;
    animation: fadeInModal 0.2s ease-out;
}

.modal-backdrop.modal-stacked {
    z-index: 1100;
    background: rgba(0, 0, 0, 0.82);
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    background: var(--bg-modal);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 1px 1px rgba(255, 255, 255, 0.15) inset;
    display: flex;
    flex-direction: column;
}

.modal-dialog.modal-lg { max-width: 860px; }
.modal-dialog.modal-xl { max-width: 1180px; }

.modal-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.25);
}

.modal-title-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.modal-btn-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.modal-body {
    padding: 22px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   TEMAS CONFINADOS EN SECCIÓN
   ========================================================================== */
.theme-compact-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 6px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.15);
    padding: 10px;
    border: 1px solid var(--border-color);
}

.theme-compact-list::-webkit-scrollbar {
    width: 6px;
}
.theme-compact-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}
.theme-compact-list::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 3px;
}

.theme-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.theme-list-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
    background: var(--bg-card-hover);
}

.theme-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-color-dots {
    display: flex;
    gap: 4px;
}

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.category-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.category-pill:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.category-pill.active {
    background: var(--primary-grad);
    color: #ffffff;
    border-color: var(--accent);
}

/* ==========================================================================
   TOAST NOTIFICACIONES
   ========================================================================== */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    background: #0f172a;
    color: #ffffff;
    border: 1px solid var(--border-bright);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    font-size: 0.88rem;
    font-weight: 600;
    min-width: 280px;
}

.toast-item.success { border-left: 4px solid #22c55e; }
.toast-item.error { border-left: 4px solid #ef4444; }
.toast-item.info { border-left: 4px solid #38bdf8; }

/* Detalle Grid */
.ticket-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}

.detail-item .label {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 700;
    margin-bottom: 2px;
}

.detail-item .val {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.detail-box-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 14px;
}

.detail-box-section h4 {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* ==========================================================================
   BOTONES HOMOGÉNEOS DE ACCESOS RÁPIDOS (1 LÍNEA)
   ========================================================================== */
.card-actions-uniform {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
}

.btn-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 6px;
    height: 32px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-card-action.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--border-color);
}
.btn-card-action.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-bright);
    color: var(--accent);
}

.btn-card-action.primary {
    background: var(--btn-grad, linear-gradient(135deg, #0284c7 0%, #0369a1 100%));
    color: #ffffff;
    border-color: var(--btn-border, #38bdf8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.btn-card-action.primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   DISEÑO RESPONSIVO: TABLETS Y SMARTPHONES
   ========================================================================== */
/* Tablet y Pantallas Medianas (768px a 1024px) */
@media (max-width: 1024px) {
    .app-container {
        padding: 16px;
    }
    .top-nav {
        flex-wrap: wrap;
        gap: 14px;
        padding: 14px 18px;
    }
    .portal-main-wrapper {
        max-width: 100%;
        padding: 0 8px;
    }
    .portal-quick-grid {
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
        gap: 12px;
    }
    .modal-dialog.modal-xl, .modal-dialog.modal-lg {
        max-width: 95vw !important;
    }
}

/* Móviles y Pantallas Pequeñas (< 768px) */
@media (max-width: 767px) {
    .app-container {
        padding: 10px;
    }
    .top-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 12px;
    }
    .brand-section {
        justify-content: flex-start;
        text-align: left;
    }
    .brand-titles h1 {
        font-size: 1.05rem;
    }
    .brand-titles p {
        font-size: 0.75rem;
    }
    .portal-header-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .user-session-chip {
        width: 100%;
        justify-content: space-between;
    }
    .dropdown-menu-container {
        width: 100%;
    }
    .btn-portal-role {
        width: 100%;
        justify-content: center;
    }
    .dropdown-menu-content {
        position: fixed;
        left: 12px;
        right: 12px;
        top: 140px;
        width: calc(100vw - 24px);
        max-width: none;
        min-width: 0;
        z-index: 9999;
    }
    .hero-banner-card {
        padding: 24px 16px;
        margin-bottom: 20px;
    }
    .hero-banner-card h2 {
        font-size: 1.35rem !important;
        line-height: 1.25;
    }
    .hero-banner-card p {
        font-size: 0.85rem !important;
    }
    .hero-btn-action {
        width: 100%;
        padding: 14px 16px;
        font-size: 0.95rem;
    }
    .portal-quick-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    .modal-dialog {
        max-width: 96vw !important;
        margin: 12px auto;
        border-radius: var(--radius-lg);
    }
    .modal-body {
        padding: 14px 12px !important;
        max-height: 75vh;
    }
    .modal-footer {
        padding: 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .modal-footer button {
        flex: 1 1 auto;
    }
    .form-row-2 {
        grid-template-columns: 1fr !important;
        gap: 0;
    }
    .tickets-table th, .tickets-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}
