/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Grupo Libera Palette */
    --libera-light: #65af46;
    --libera-default: #458d2d;
    --libera-dark: #367c2e;
    --libera-gray: #898989;
    --libera-black: #2d2d2d;

    --primary-color: var(--libera-default);
    --secondary-color: var(--libera-dark);
    --accent-color: var(--libera-light);
    --bg-color: #f8f9fa;
    --text-color: var(--libera-black);
    --border-color: #dee2e6;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;

    /* Typography */
    --font-titles: 'Lora', serif;
    --font-sans: 'Rethink Sans', sans-serif;
    /* Sidebar Widths */
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-titles);
    font-weight: 700;
    color: var(--libera-dark);
}

html,
body {
    height: 100%;
}

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 2rem;
    background-color: var(--bg-color);
    position: relative;
    overflow-x: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--libera-light);
    filter: blur(150px);
    top: -150px;
    right: -150px;
    opacity: 0.1;
    z-index: 0;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: var(--libera-default);
    filter: blur(100px);
    bottom: -100px;
    left: -100px;
    opacity: 0.1;
    z-index: 0;
}

.login-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    padding: 60px 50px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
    width: 100%;
}

.login-logo {
    max-width: 260px;
    height: auto;
    margin-bottom: 25px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.login-header p {
    color: #7f8c8d;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: #7f8c8d;
    font-size: 14px;
}

/* Navbar */
.navbar {
    background-color: var(--libera-dark);
    color: white;
    padding: 0 30px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1001; /* Above sidebar */
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-brand img {
    filter: brightness(0) invert(1);
    /* Ensure logo is white if URL is principal */
}

.btn-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.3s, transform 0.3s;
}

.btn-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Navbar Components */
.notifications-dropdown {
    position: relative;
    margin-right: 15px;
}

.notifications-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: inline-flex; /* Changed from flex to inline-flex for better alignment in some contexts */
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    position: relative;
    padding: 0; /* Ensure no padding interferes */
    line-height: 1;
}

.notifications-toggle i {
    display: block;
}

.notifications-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--libera-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.notifications-menu {
    position: absolute;
    top: 60px; /* Adjusted from 55px */
    right: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 2000;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.notifications-menu.show {
    display: block;
}

.notifications-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header span {
    font-weight: 700;
    color: var(--libera-black);
}

.mark-all {
    font-size: 11px;
    color: var(--libera-default);
    text-decoration: none;
    font-weight: 600;
}

.notification-item {
    display: flex;
    padding: 15px 20px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f1f1;
    transition: background 0.2s;
    align-items: center;
    gap: 15px;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.unread {
    background: rgba(101, 175, 70, 0.03);
}

.notif-icon {
    width: 36px; /* Slightly smaller for better fit */
    height: 36px;
    border-radius: 10px; /* Modern square-rounded look */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

/* Notification Types Colors */
.notif-icon.nuevo, .notif-icon.aceptado {
    background: rgba(46, 204, 113, 0.15);
    color: #27ae60;
}

.notif-icon.asignado, .notif-icon.workflow {
    background: rgba(52, 152, 219, 0.15);
    color: #2980b9;
}

.notif-icon.comentario {
    background: rgba(155, 89, 182, 0.15);
    color: #8e44ad;
}

.notif-icon.estado, .notif-icon.turno {
    background: rgba(243, 156, 18, 0.15);
    color: #d35400;
}

.notif-icon.rechazado {
    background: rgba(231, 76, 60, 0.15);
    color: #c0392b;
}

/* Fallback/Default for icons */
.notif-icon {
    background: #f1f5f9;
    color: #64748b;
}

.notif-content p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--libera-black);
}

.notifications-footer {
    padding: 12px;
    text-align: center;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.notifications-footer a {
    font-size: 12px;
    font-weight: 700;
    color: var(--libera-default);
    text-decoration: none;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
    margin-left: 10px;
}

.profile-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    font-family: var(--font-sans);
    font-weight: 500;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.profile-menu {
    position: absolute;
    top: 55px;
    right: 0;
    width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 2000;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.profile-menu.show {
    display: block;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--libera-black);
    font-size: 14px;
    transition: background 0.2s;
    border: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.profile-menu-item:hover {
    background: #f8fafc;
    color: var(--libera-default);
}

.profile-menu-item.text-danger {
    color: var(--danger-color) !important;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Container and Layout */
.container {
    display: flex;
    min-height: calc(100vh - 70px);
    margin-top: 70px;
}

/* Sidebar Core */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--libera-black);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
    flex-shrink: 0;
    height: calc(100vh - 70px);
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    color: white;
    z-index: 1000;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Menu Structure */
.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-menu li {
    position: relative;
    width: 100%;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    height: 50px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

/* Icon Container - Crucial for alignment */
.nav-icon {
    min-width: var(--sidebar-collapsed-width);
    width: var(--sidebar-collapsed-width);
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: color 0.3s;
}

.nav-label {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 14px;
    font-weight: 500;
}

/* Commmon Hover States */
.sidebar-menu li a:hover {
    background-color: rgba(101, 175, 70, 0.1);
    color: white;
}

.sidebar-menu li a:hover .nav-icon {
    color: var(--libera-light);
}

.sidebar-menu li a.active {
    background-color: rgba(101, 175, 70, 0.2);
    color: white;
    font-weight: 700;
    border-left: 4px solid var(--libera-light);
}

/* Collapsed State Management */
.sidebar.collapsed .nav-label {
    opacity: 0;
    visibility: hidden;
    width: 0;
    display: inline-block;
    overflow: hidden;
}

.sidebar.collapsed .menu-separator span {
    opacity: 0;
    visibility: hidden;
}

/* Separators */
.menu-separator {
    padding: 20px 0 10px 0;
    display: flex;
    align-items: center;
    height: 45px;
    overflow: hidden;
}

.menu-separator span {
    padding-left: 25px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    white-space: nowrap;
    transition: opacity 0.3s;
}

/* Submenus */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.submenu-link {
    height: 45px !important;
}

.submenu-link .nav-icon {
    font-size: 14px;
    opacity: 0.8;
}

.submenu-link .nav-label {
    font-size: 13px;
    opacity: 0.8;
}

.sidebar.collapsed .sidebar-submenu {
    display: none !important;
}

/* Main Content Adjustment */
.main-content {
    flex: 1;
    padding: 30px;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-is-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.container.sidebar-collapsed .main-content,
.sidebar-is-collapsed .main-content {
    margin-left: 70px;
}

/* Buttons - Premium Design */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-sans);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--libera-light) 0%, var(--libera-default) 100%);
    color: white !important;
    box-shadow: 0 8px 20px rgba(69, 141, 45, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(69, 141, 45, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background-color: var(--libera-black);
    color: white !important;
    box-shadow: 0 8px 20px rgba(45, 45, 45, 0.2);
}

.btn-secondary:hover {
    background-color: #1a1a1a;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(45, 45, 45, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white !important;
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
    color: white !important;
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(214, 48, 49, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white !important;
}

.btn-info:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(9, 132, 227, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 10px;
}

.btn-lg {
    padding: 18px 36px;
    font-size: 17px;
    border-radius: 18px;
}

.btn-block {
    width: 100%;
}

/* Forms and Glassmorphism - Premium Design */
.form-card,
.comments-card,
.attachments-card,
.actions-card,
.ticket-details-card,
.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 35px;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.04);
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--libera-dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-control {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    font-size: 15px;
    color: var(--libera-black);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-sans);
}

.form-control:focus {
    outline: none;
    background-color: white;
    border-color: var(--libera-light);
    box-shadow: 0 0 0 4px rgba(101, 175, 70, 0.12);
    transform: translateY(-1px);
}

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

.form-row {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    min-width: calc(50% - 15px);
}

.col-md-6 {
    flex: 0 0 calc(50% - 15px);
}

.col-md-12 {
    flex: 0 0 100% !important;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Custom File Upload Component */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.file-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 45px 30px;
    background: rgba(101, 175, 70, 0.03);
    border: 2px dashed rgba(101, 175, 70, 0.15);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.4s ease;
    text-align: center;
}

.file-upload-box:hover {
    background: rgba(101, 175, 70, 0.07);
    border-color: var(--libera-light);
    transform: scale(1.01);
}

.file-upload-box i {
    font-size: 44px;
    color: var(--libera-default);
    margin-bottom: 15px;
    transition: transform 0.3s;
}

.file-upload-box:hover i {
    transform: translateY(-5px);
}

.file-upload-box span {
    font-weight: 700;
    font-size: 16px;
    color: var(--libera-dark);
    margin-bottom: 8px;
}

.file-upload-box p {
    font-size: 13px;
    color: var(--libera-gray);
    margin: 0;
}

.file-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.file-name-display {
    margin-top: 15px;
    padding: 12px 20px;
    background: white;
    border-radius: 12px;
    font-size: 14px;
    color: var(--libera-default);
    font-weight: 600;
    display: none;
    border: 1px solid rgba(101, 175, 70, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.form-text {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

.text-danger {
    color: var(--danger-color);
}

.text-muted {
    color: #7f8c8d;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* Badge */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    color: white;
}

.priority-baja {
    background-color: #95a5a6;
}

.priority-media {
    background-color: #3498db;
}

.priority-alta {
    background-color: #f39c12;
}

.priority-urgente {
    background-color: #e74c3c;
}

/* Dashboard */
.dashboard h1 {
    margin-bottom: 30px;
    color: var(--dark-text);
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: white;
    padding: 25px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--libera-light);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--libera-default);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 65px;
    height: 65px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

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

.stat-info h3 {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    color: var(--libera-black);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-info p {
    margin: 0;
    color: var(--libera-gray);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-actions {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dashboard-actions h3 {
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.recent-tickets {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.recent-tickets h3 {
    margin-bottom: 20px;
}

/* Tables */
.table-responsive {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background-color: var(--secondary-color);
    color: white;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table-hover tbody tr {
    transition: background-color 0.2s;
}

.ticket-folio {
    color: var(--primary-color);
    font-weight: 600;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 16px;
}

.no-data i {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    color: var(--dark-text);
}

.ticket-title {
    font-size: 16px;
    color: #7f8c8d;
    margin-top: 5px;
}

/* Ticket View */
.ticket-view {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 25px;
    align-items: start;
}

.ticket-view-left,
.ticket-view-right {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.ticket-info-card,
.timeline-card,
.comments-card,
.attachments-card,
.actions-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.ticket-info-card h3,
.timeline-card h3,
.comments-card h3,
.attachments-card h3,
.actions-card h3 {
    margin-bottom: 20px;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
}

.info-item label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 13px;
}

.info-item span {
    font-size: 15px;
    color: var(--dark-text);
}

.description-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.description-section label {
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
}

/* Timeline (Estilo Amazon Premium) */
.timeline {
    position: relative;
    padding: 20px 0 20px 40px;
    display: flex;
    flex-direction: column-reverse;
    /* Hace que el más nuevo esté abajo si es necesario, pero el usuario pidió descendente vertical */
}

/* Para que sea descendente (Antiguo arriba, Nuevo abajo) */
.timeline {
    display: block;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    opacity: 0.9;
    transition: all 0.3s;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item:hover {
    opacity: 1;
    transform: translateX(5px);
}

.timeline-marker {
    position: absolute;
    left: -32px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #bdc3c7;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #bdc3c7;
    z-index: 2;
}

.timeline-start .timeline-marker {
    background-color: var(--success-color);
    box-shadow: 0 0 0 2px var(--success-color);
}

/* Colores por tipo de acción */
.type-creacion {
    background-color: var(--success-color);
    box-shadow: 0 0 0 2px var(--success-color);
}

.type-sistema {
    background-color: #95a5a6;
    box-shadow: 0 0 0 2px #95a5a6;
}

.type-visto {
    background-color: #3498db;
    box-shadow: 0 0 0 2px #3498db;
}

.type-reasignacion {
    background-color: #f39c12;
    box-shadow: 0 0 0 2px #f39c12;
}

.type-cambio_estado {
    background-color: #9b59b6;
    box-shadow: 0 0 0 2px #9b59b6;
}

.type-transferencia {
    background-color: #e74c3c;
    box-shadow: 0 0 0 2px #e74c3c;
}

.timeline-content {
    background-color: white;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.timeline-type {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.timeline-date {
    font-size: 12px;
    color: #95a5a6;
    font-weight: normal;
}

.timeline-content p {
    margin: 8px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.4;
}

.timeline-content small {
    display: block;
    margin-top: 5px;
    font-style: italic;
}

/* Comments */
.comments-list {
    margin-bottom: 25px;
}

.comment-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid var(--info-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-header strong {
    color: var(--dark-text);
}

.comment-date {
    font-size: 12px;
    color: #7f8c8d;
}

.comment-item p {
    color: var(--dark-text);
    line-height: 1.6;
}

.comment-form {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* Attachments */
.attachments-list {
    margin-bottom: 20px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
}

.attachment-item i {
    color: var(--primary-color);
    font-size: 20px;
}

.attachment-item a {
    flex: 1;
    color: var(--primary-color);
    text-decoration: none;
}

.attachment-item a:hover {
    text-decoration: underline;
}

.attachment-item small {
    color: #7f8c8d;
}

.upload-form {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--dark-text);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Responsive Layout Adjustment */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0 !important;
        padding: 20px;
    }

    .container.sidebar-collapsed .main-content,
    .sidebar-is-collapsed .main-content {
        margin-left: 0 !important;
    }
}

/* Global Collapse Support */
.sidebar-is-collapsed .main-content,
.container.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Pestañas y Filtros de Tickets */
.tickets-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
}

.ticket-tab {
    padding: 0.5rem 1.5rem;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s ease;
}

.ticket-tab:hover {
    background: #f0f0f0;
    color: var(--primary-color);
}

.ticket-tab.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-chip {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    background: #eee;
    color: #555;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
}

.form-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: 30px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--libera-black);
    margin-bottom: 10px;
    display: block;
    font-family: var(--font-sans);
}

.form-control {
    width: 100%;
    padding: 12px 18px;
    font-size: 15px;
    border: 2px solid #edf2f7;
    border-radius: 12px;
    background-color: #f8fafc;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--libera-black);
    font-family: var(--font-sans);
}

.form-control:focus {
    border-color: var(--libera-light);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(101, 175, 70, 0.15);
    outline: none;
}

/* Custom File Upload Component */
.file-upload-wrapper {
    position: relative;
    width: 100%;
}

.file-upload-box {
    border: 2px dashed #cbd5e0;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.file-upload-box:hover {
    border-color: var(--libera-light);
    background: rgba(101, 175, 70, 0.03);
}

.file-upload-box i {
    font-size: 32px;
    color: var(--libera-default);
}

.file-upload-box span {
    font-weight: 600;
    color: var(--libera-gray);
    font-size: 14px;
}

.file-upload-box small {
    color: #a0aec0;
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Buttons Modern */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    letter-spacing: 0.3px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--libera-light) 0%, var(--libera-default) 100%);
    color: white !important;
    box-shadow: 0 8px 20px rgba(69, 141, 45, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(69, 141, 45, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--libera-black);
    color: white !important;
    box-shadow: 0 8px 20px rgba(45, 45, 45, 0.2);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(45, 45, 45, 0.3);
    background: #1a1a1a;
}

/* Modal System - Premium Design */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 45, 45, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 450px;
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 30px 35px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, rgba(101, 175, 70, 0.05), transparent);
}

.modal-header h3 {
    margin: 0;
    font-size: 22px;
    color: var(--libera-dark);
}

.modal-close {
    background: none;
    border: none;
    color: var(--libera-gray);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--danger-color);
    background: rgba(231, 76, 60, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0 35px 35px;
}

.modal-body p {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.password-input-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--libera-gray);
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--libera-default);
}

.modal-footer {
    padding: 0 35px 35px;
    display: flex;
    gap: 15px;
}

.modal-footer .btn {
    flex: 1;
}

/* Utils */
.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

/* Timeline Paused State */
.timeline-item.timeline-paused {
    border-left: 3px solid #ff9800 !important;
    background-color: rgba(255, 152, 0, 0.05);
}

.timeline-marker.type-pausado {
    background-color: #ff9800 !important;
    border-color: #fff !important;
}

.badge-pausado {
    background-color: #ff9800;
    color: #fff;
}

/* Persistent labels to avoid auto-hide script */
.pause-info-box {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: .25rem;
}

.pause-info-box.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.pause-info-box.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.pause-history-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: .25rem;
}

/* Responsividad Móvil Premium Refinada */
@media (max-width: 768px) {
    .navbar {
        padding: 0 8px;
        gap: 5px;
        justify-content: space-between;
    }

    .navbar-brand {
        gap: 5px;
        flex: 1;
        min-width: 0;
    }

    .navbar-brand img {
        height: 25px !important;
        max-width: 120px;
        object-fit: contain;
    }

    .navbar-menu {
        gap: 5px;
        flex-shrink: 0;
    }

    .sidebar {
        width: 280px;
        position: fixed !important;
        left: -300px !important;
        top: 0 !important;
        bottom: 0 !important;
        z-index: 10001 !important;
        /* Valor muy alto para evitar solapamiento */
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 15px 0 30px rgba(0, 0, 0, 0.3);
        height: 100vh !important;
        background-color: var(--libera-black) !important;
    }

    .sidebar.mobile-open {
        left: 0 !important;
    }

    .sidebar-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        z-index: 10000 !important;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 15px 10px !important;
        width: 100% !important;
        margin-top: 70px !important;
    }

    /* Tablas sin hacks de margen negativo que causan bugs visuales */
    .table-responsive {
        border-radius: 8px;
        margin-bottom: 20px;
        width: 100%;
        overflow-x: auto;
        border: 1px solid rgba(0, 0, 0, 0.05);
        background: white;
    }

    .table th,
    .table td {
        padding: 12px 10px;
        font-size: 13px;
        white-space: nowrap;
    }

    .notifications-menu {
        width: calc(100vw - 20px) !important;
        right: 10px !important;
        left: 10px !important;
        position: fixed !important;
        top: 65px !important;
    }

    /* Ocultar textos molestos en móvil */
    .profile-btn span,
    .navbar-brand span,
    .user-info span,
    .btn-toggle span {
        display: none !important;
    }

    .btn {
        width: 100%;
        margin-bottom: 8px;
        padding: 12px;
    }

    /* En móvil, las etiquetas solo se ven si el sidebar no está colapsado o si se expande manualmente */
    .sidebar.collapsed .nav-label {
        opacity: 0 !important;
        visibility: hidden !important;
        width: 0 !important;
    }

    .sidebar.collapsed .sidebar-submenu {
        display: none !important;
    }
    
    .sidebar.collapsed .nav-icon {
        min-width: var(--sidebar-collapsed-width) !important;
        width: var(--sidebar-collapsed-width) !important;
    }

    .sidebar.collapsed .menu-separator span {
        opacity: 0 !important;
        visibility: hidden !important;
    }
}

@media (max-width: 480px) {
    .navbar-brand img {
        max-width: 100px;
    }

    .btn-toggle {
        width: 32px;
        height: 32px;
    }
}

/* Premium Components (Workflow / Tickets Cards) */
:root {
    --wf-primary: #65af46;
    --wf-success: #00b894;
    --wf-danger: #d63031;
    --wf-warning: #fdcb6e;
    --wf-gray: #b2bec3;
    --wf-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.workflow-tabs-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    margin-top: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
}

.workflow-tab {
    padding: 12px 25px;
    text-decoration: none;
    color: #777;
    font-weight: 600;
    border-radius: 10px 10px 0 0;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    white-space: nowrap;
}

.workflow-tab:hover {
    color: var(--wf-primary);
    background: rgba(101, 175, 70, 0.05);
}

.workflow-tab.active {
    color: var(--wf-primary);
    background: white;
}

.workflow-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--wf-primary);
    border-radius: 3px;
}

.tab-counter {
    background: var(--wf-danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 50px;
    margin-left: 5px;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.workflow-card {
    background: white;
    border-radius: 15px;
    box-shadow: var(--wf-shadow);
    padding: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workflow-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: var(--wf-primary);
}

.card-status-strip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.card-status-strip.completado {
    background: var(--wf-success);
}

.card-status-strip.rechazado {
    background: var(--wf-danger);
}

.card-status-strip.en_proceso,
.card-status-strip.en\ proceso {
    background: var(--wf-primary);
}

.card-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 12px;
}

.card-folio {
    font-weight: 800;
    color: #555;
}

.wf-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.wf-initiator {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-progress {
    margin: 15px 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 6px;
}

.progress-text {
    font-weight: 700;
    color: var(--wf-primary);
}

.modern-progress {
    height: 6px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.mod-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--wf-primary), #65af46);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.badge-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-turn {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-turn.active {
    background: var(--wf-warning);
    color: #856404;
}

.card-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-step-name {
    font-size: 0.8rem;
    color: #555;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.btn-card-action {
    width: 30px;
    height: 30px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wf-primary);
    transition: all 0.2s;
}

.workflow-card:hover .btn-card-action {
    background: var(--wf-primary);
    color: white;
    transform: translateX(3px);
}

.animate-up {
    animation: animateUp 0.5s ease forwards;
}

@keyframes animateUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.empty-state-card {
    grid-column: 1 / -1;
    background: white;
    padding: 40px;
    text-align: center;
    border-radius: 15px;
    box-shadow: var(--wf-shadow);
    border: 2px dashed #eee;
}

.filter-chip {
    padding: 8px 16px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.filter-chip:hover {
    background: #e2e8f0;
    color: #475569;
}

.filter-chip.active {
    background: var(--libera-default);
    color: white;
    box-shadow: 0 4px 12px rgba(101, 175, 70, 0.3);
}

.tab-counter-inline {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 50px;
    margin-left: 10px;
}

/* Compact Grid and Cards for Dashboard */
.compact-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.ticket-card-compact {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    padding: 12px 15px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-card-compact:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: var(--wf-primary);
}

.compact-folio {
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compact-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compact-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.compact-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

.compact-meta {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}
/* =========================================
   GRID / LIST VIEW TOGGLE SYSTEM
   ========================================= */
.page-header .view-switcher {
    display: inline-flex !important;
    background: #f1f5f9 !important;
    border-radius: 8px !important;
    padding: 4px !important;
    margin-left: 15px !important;
    border: 1px solid #e2e8f0 !important;
    height: 40px !important;
    align-items: center !important;
}

.page-header .view-btn {
    background: transparent !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.1rem !important;
    height: 100% !important;
}

.page-header .view-btn:hover {
    color: var(--libera-default) !important;
}

.page-header .view-btn.active {
    background: white !important;
    color: var(--libera-light, #65af46) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

/* List View Overrides */
.view-list .workflow-grid,
.view-list .tickets-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
}

/* Aplicar flex-row solo si grid o list está definido explicitamente o mediante contenedor */
.view-list .workflow-card,
.view-list .ticket-card,
.view-list .oc-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 15px 25px !important;
    margin-bottom: 0 !important;
    gap: 20px !important;
    width: 100% !important;
}

/* Reset specific components for flex row */
.view-list .card-top { 
    margin-bottom: 0 !important;
    min-width: 150px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 5px !important;
}

.view-list .wf-title { 
    margin-bottom: 0 !important;
    font-size: 1rem !important;
    flex: 1 !important;
}

.view-list .wf-initiator { margin-top: 0 !important; }

.view-list .card-info-row { 
    flex-direction: column !important;
    gap: 5px !important;
    min-width: 150px !important;
}

.view-list .info-item.text-right { text-align: left !important; }

.view-list .card-progress { 
    margin: 0 !important;
    min-width: 150px !important;
    flex: 1 !important;
}

.view-list .card-footer { 
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    min-width: 150px !important;
}

.view-list .oc-details-content { 
    width: 100% !important;
    margin-top: 15px !important;
    border-top: 1px solid #eee !important;
    padding-top: 15px !important;
}

.view-list .card-status-strip { 
    width: 6px !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
}

@media (max-width: 1200px) {
    .view-list .workflow-card,
    .view-list .ticket-card,
    .view-list .oc-card {
        flex-wrap: wrap !important;
    }
}

/* Collapsible Menus - Restored native behavior for stability */
.collapse:not(.show) {
    display: none;
}

.collapsing {
    position: relative;
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

.dropdown-toggle {
    position: relative;
    cursor: pointer;
}

/* Sidebar specific arrow indicator */
.sidebar-menu .dropdown-toggle::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    transition: transform 0.3s ease;
    display: inline-block;
}

.sidebar-menu .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Submenu deeper items consistency */
.sidebar-menu .collapse li a {
    padding-left: 0;
    font-size: 0.9em;
    background: rgba(0, 0, 0, 0.2);
    border-left: none;
}

/* Premium Modals - Libera Identity - Bootstrap 4 Compatible */
.modal {
    background-color: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Bootstrap 4 sets .modal.show to display:block, we convert to flex to center */
.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-dialog {
    margin: 0 !important;  /* flex handles centering */
    width: 100%;
    max-width: 520px;
    position: relative;
    pointer-events: auto;
}

.modal-content {
    background-color: #fff;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: visible; /* Allow selects to overflow if needed */
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    width: 100%;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    background: linear-gradient(135deg, #65af46 0%, #4a8c2f 100%);
    padding: 22px 30px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.modal-title {
    font-family: 'Lora', serif;
    font-weight: 700;
    color: #fff;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
}

.modal-header .close {
    color: #fff;
    opacity: 0.8;
    text-shadow: none;
    transition: 0.2s;
    outline: none;
}

.modal-header .close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    font-family: 'Rethink Sans', sans-serif;
    color: #334155;
    background: #fff;
}

.modal-footer {
    padding: 20px 30px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Modal form elements */
.modal-body label {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.modal-body .form-control {
    border-radius: 12px;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    font-size: 0.95rem;
    transition: 0.2s;
    background: #fdfdfd;
}

.modal-body .form-control:focus {
    border-color: #65af46;
    box-shadow: 0 0 0 4px rgba(101, 175, 70, 0.1);
    background: #fff;
}

/* Fix for Select visibility in modals */
.modal-body select.form-control {
    height: auto !important;
    cursor: pointer;
    appearance: auto;
}

/* Global Utilities */
.resolution-textarea {
    font-family: 'Rethink Sans', sans-serif !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    color: #334155 !important;
    border-radius: 12px !important;
}

.input-file-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* =========================================
   GRID / LIST VIEW TOGGLE SYSTEM
   ========================================= */
.page-header .view-switcher {
    display: inline-flex !important;
    background: #f1f5f9 !important;
    border-radius: 8px !important;
    padding: 4px !important;
    margin-left: 15px !important;
    border: 1px solid #e2e8f0 !important;
    height: 40px !important;
    align-items: center !important;
}

.page-header .view-btn {
    background: transparent !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.1rem !important;
    height: 100% !important;
}

.page-header .view-btn:hover {
    color: var(--libera-default) !important;
}

.page-header .view-btn.active {
    background: white !important;
    color: var(--libera-light, #65af46) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

/* List View Overrides */
.view-list .workflow-grid,
.view-list .tickets-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
}

/* Aplicar flex-row solo si grid o list está definido explicitamente o mediante contenedor */
.view-list .workflow-card,
.view-list .ticket-card,
.view-list .oc-card {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 15px 25px !important;
    margin-bottom: 0 !important;
    gap: 20px !important;
    width: 100% !important;
}

/* Reset specific components for flex row */
.view-list .card-top { 
    margin-bottom: 0 !important;
    min-width: 150px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 5px !important;
}

.view-list .wf-title { 
    margin-bottom: 0 !important;
    font-size: 1rem !important;
    flex: 1 !important;
}

.view-list .wf-initiator { margin-top: 0 !important; }

.view-list .card-info-row { 
    flex-direction: column !important;
    gap: 5px !important;
    min-width: 150px !important;
}

.view-list .info-item.text-right { text-align: left !important; }

.view-list .card-progress { 
    margin: 0 !important;
    min-width: 150px !important;
    flex: 1 !important;
}

.view-list .card-footer { 
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    min-width: 150px !important;
}

.view-list .oc-details-content { 
    width: 100% !important;
    flex: 0 0 100% !important;
    margin-top: 15px !important;
    border-top: 1px solid #eee !important;
    padding-top: 15px !important;
}

/* Three-column layout for expanded details in LIST VIEW only */
.view-list .oc-details-layout {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    align-items: stretch !important;
}

.view-list .oc-details-info {
    flex: 1 1 350px !important;
}

.view-list .oc-details-timeline {
    flex: 1 1 300px !important;
    display: flex !important;
    flex-direction: column !important;
}

.view-list .oc-details-actions {
    flex: 0 0 250px !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Modify timeline specifically for this layout to ensure it fits horizontally or wraps */
.view-list .oc-life-timeline {
    flex-wrap: wrap !important;
    gap: 5px !important;
}

.view-list .oc-life-timeline .timeline-step {
    flex: 1 1 auto !important;
    min-width: 60px !important;
}

.view-list .card-status-strip { 
    width: 6px !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
}

@media (max-width: 1200px) {
    .view-list .workflow-card,
    .view-list .ticket-card,
    .view-list .oc-card {
        flex-wrap: wrap !important;
    }
}