/* Reset y variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --border: #e2e8f0;
    
    /* Tema claro (por defecto) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

/* Tema oscuro */
html[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: #334155;
    --primary-light: #1e3a8a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #8e9dd6 0%, #edebef 100%);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
}

html[data-theme="dark"] body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    background-attachment: fixed;
}

/* Asegurar que todos los elementos de texto tengan colores adecuados */
p, span, li, label, a {
    color: var(--text-primary);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

/* ========================================
   BOTÓN DE TOGGLE DE TEMA
   ======================================== */

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    background: var(--bg-tertiary);
    transform: scale(1.1);
}

.theme-toggle-btn i {
    transition: transform 0.3s ease;
}

.theme-toggle-btn:hover i {
    transform: rotate(20deg);
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 0px;
}

.login-logo img {
    max-width: 150px;
    height: auto;
}

.login-title {
    text-align: center;
    color: var(--text-primary);
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.login-subtitle {
    text-align: center;
    color: var(--secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

.sidebar {
    width: 260px;
    background: var(--bg-primary);
    box-shadow: var(--shadow);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    left: 0;
    top: 0;
    z-index: 999;
}
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: block;
}
.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar.mobile-hidden {
    display: none;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.sidebar-header img {
    max-width: 120px;
    height: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu li.menu-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
    display: block;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--bg-secondary);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.sidebar-menu i {
    margin-right: 12px;
    font-size: 18px;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    background: var(--bg-primary);
    transition: margin-left 0.3s ease;
}

.sidebar.active {
    transform: translateX(0) !important;
    z-index: 1001;
}

.topbar {
    background: var(--bg-primary);
    padding: 20px 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.topbar-left h1 {
    font-size: 24px;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.content-area {
    padding: 30px;
}

/* Responsive sidebar */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: 240px;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .sidebar.hidden {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
    }
    .main-content.sidebar-hidden {
    margin-left: 0;
    }
    .main-content.sidebar-open {
        margin-left: 0;
    }
}

@media (min-width: 1025px) {
    .sidebar.hidden {
        width: 0;
        overflow: hidden;
        box-shadow: none;
    }
    .main-content.sidebar-hidden {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 16px;
    }
    .topbar-left h1 {
        font-size: 18px;
    }
    .topbar-left {
        flex: 1;
    }
    .content-area {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .metrics-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .topbar {
        flex-direction: column;
        gap: 12px;
    }
    .topbar-left {
        width: 100%;
    }
    .topbar-left h1 {
        font-size: 16px;
        margin: 0;
    }
    .topbar-right {
        width: 100%;
    }
    .user-info {
        justify-content: flex-end;
    }
    .content-area {
        padding: 12px;
    }
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-primary);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Card */
.card {
    background: var(--bg-primary);
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: background-color 0.3s ease;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}
/* --- Styles extraídos de views/dashboard/dashboard.php --- */

/* Reset y reglas específicas para el dashboard original */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/*body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}*/

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-primary);
    padding: 30px 0;
    box-shadow: var(--shadow);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: background-color 0.3s ease;
}

.logo {
    padding: 0 30px 40px 30px;
    text-align: center;
}

.logo img {
    max-width: 140px;
    height: auto;
}

.menu {
    list-style: none;
}

.menu-item {
    padding: 14px 30px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.menu-item.active {
    background: var(--bg-secondary);
    color: var(--primary);
    border-left-color: var(--primary);
}

.menu-icon {
    font-size: 18px;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 40px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 28px;
    color: var(--text-primary);
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: inherit;
}

.icon-blue { background: #E3F2FD; }
.icon-orange { background: #FFF3E0; }
.icon-purple { background: #F3E5F5; }
.icon-green { background: #E8F5E9; }
.icon-red { background: #FFEBEE; }
.icon-teal { background: #E0F2F1; }

/* Modo oscuro para iconos */
[data-theme="dark"] .icon-blue { background: #1e3a8a; color: #60a5fa; }
[data-theme="dark"] .icon-blue i { color: #60a5fa; }
[data-theme="dark"] .icon-orange { background: #7c2d12; color: #fb923c; }
[data-theme="dark"] .icon-orange i { color: #fb923c; }
[data-theme="dark"] .icon-purple { background: #581c87; color: #d8b4fe; }
[data-theme="dark"] .icon-purple i { color: #d8b4fe; }
[data-theme="dark"] .icon-green { background: #15803d; color: #4ade80; }
[data-theme="dark"] .icon-green i { color: #4ade80; }
[data-theme="dark"] .icon-red { background: #7f1d1d; color: #f87171; }
[data-theme="dark"] .icon-red i { color: #f87171; }
[data-theme="dark"] .icon-teal { background: #134e4a; color: #2dd4bf; }
[data-theme="dark"] .icon-teal i { color: #2dd4bf; }

/* Modo oscuro para inputs y textareas */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    background: var(--bg-primary);
    border-color: var(--primary);
    color: var(--text-primary);
}

/* Asegurar que los form-control tengan buen contraste */
[data-theme="dark"] .form-control {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .form-control:focus {
    background: var(--bg-primary);
    border-color: var(--primary);
    color: var(--text-primary);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

/* Metrics Row */
.metrics-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

/* Tickets Section */
.tickets-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-success {
    background: #10B981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* Filters */
.filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
}

.filter-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: border 0.3s;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
}

tbody td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
}

tbody tr:hover {
    background: var(--bg-secondary);
}

.ticket-id {
    font-weight: 600;
    color: #4169E1;
}

/* Badge */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-ti {
    background: #E3F2FD;
    color: #1976D2;
}

.badge-procesos {
    background: #F3E5F5;
    color: #7B1FA2;
}

.badge-pendiente {
    background: #FFF3E0;
    color: #F57C00;
}

.badge-proceso {
    background: #E3F2FD;
    color: #1976D2;
}

.badge-resuelto {
    background: #E8F5E9;
    color: #388E3C;
}

.badge-baja {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.badge-media {
    background: #FFF3E0;
    color: #F57C00;
}

.badge-alta {
    background: #FFEBEE;
    color: #C62828;
}

.badge-urgente {
    background: #C62828;
    color: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.btn-view {
    background: #E3F2FD;
    color: #1976D2;
}

.btn-view:hover {
    background: #1976D2;
    color: white;
}

.btn-edit {
    background: #FFF3E0;
    color: #F57C00;
}

.btn-edit:hover {
    background: #F57C00;
    color: white;
}

.btn-reassign {
    background: #F3E5F5;
    color: #7B1FA2;
}

.btn-reassign:hover {
    background: #7B1FA2;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transition: background-color 0.3s ease;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.icon-button {
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-secondary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    font-family: inherit;
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .stats-container,
    .metrics-container {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- fin de estilos extraídos --- */

.card-body {
    padding: 25px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-secondary);
}

/* Asegurar que thead sea visible en modo oscuro */
[data-theme="dark"] thead {
    background: var(--bg-secondary);
}

[data-theme="dark"] thead th {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] thead tr {
    background: var(--bg-secondary) !important;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-primary);
}

tr:hover {
    background: var(--bg-secondary);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-secondary {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary);
}

/* Form Ticket */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

select.form-control,
textarea.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control:focus,
textarea.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Priority Selector */
.priority-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.priority-option {
    flex: 1;
    min-width: 150px;
}

.priority-option input[type="radio"] {
    display: none;
}

.priority-label {
    display: block;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.priority-option input[type="radio"]:checked + .priority-label {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.priority-label:hover {
    border-color: var(--primary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    transition: background-color 0.3s ease;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .topbar {
        padding: 15px 20px;
    }

    .topbar-left h1 {
        font-size: 20px;
    }

    .content-area {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .priority-options {
        flex-direction: column;
    }

    .table-responsive {
        overflow-x: scroll;
    }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

.w-100 {
    width: 100%;
}
.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.status-open { background: #fef3c7; color: #92400e; }
.status-in_progress { background: #dbeafe; color: #1e40af; }
.status-resolved { background: #d1fae5; color: #065f46; }
.status-closed { background: #f3e8ff; color: #581c87; }

.priority {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: bold;
}

.priority-baja { background: #dcfce7; color: #166534; }
.priority-media { background: #fef3c7; color: #92400e; }
.priority-alta { background: #fee2e2; color: #dc2626; }
.priority-urgente { background: #fecaca; color: #b91c1c; }

/* --- Styles extraídos de views/tickets/create.php --- */

/* Form Containevar(--bg-primary);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    transition: background-color 0.3s ease
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.form-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

/* Form Groups */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.form-group-full {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.required {
    color: #EF4444;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-primary);
    font-family: inherit;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
}

.form-control:disabled {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 140px;
    line-height: 1.6;
}

.form-help {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.char-counter {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    text-align: right;
}

.char-counter.valid {
    color: #10B981;
}

/* Select Styling */
select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Priority Selector */
.priority-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.priority-option {
    position: relative;
}

.priority-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.priority-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 110px;
}

.priority-option input:checked + .priority-card {
    border-color: var(--primary);
    background: var(--primary-light);
}

.priority-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.priority-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.priority-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.priority-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* File Upload */
.file-upload-wrapper {
    margin-top: 12px;
}

.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    border-style: solid;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.upload-text {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 15px;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 13px;
}

.file-input {
    display: none;
}

.uploaded-files {
    margin-top: 16px;
    display: none;
}

.uploaded-files.has-files {
    display: block;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 8px;
    color: var(--text-primary);
    transition: background-color 0.3s ease;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon {
    font-size: 20px;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.remove-file {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 20px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s;
}

.remove-file:hover {
    background: #FEE2E2;
}

/* Buttons (specific to create form) */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid var(--border);
}

/* Info Card */
.info-card {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease;
}

.info-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.info-list {
    padding-left: 0;
    list-style: none;
}

.info-list li {
    padding: 10px 0;
    color: #333;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.info-list li::before {
    content: "✓";
    color: #10B981;
    font-weight: bold;
    flex-shrink: 0;
}

/* Responsive for create form */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .priority-selector {
        grid-template-columns: 1fr 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

    .form-actions .btn-primary {
        max-width: 100%;
    }
}
/* --- Estilos del Dashboard Analítico --- */
.analytics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.summary-content {
    flex: 1;
}

.summary-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.summary-value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-container h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.analytics-section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.analytics-section h2 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.analytics-table thead {
    background: #f9f9f9;
}

.analytics-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.analytics-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.analytics-table tbody tr:hover {
    background: #f9f9f9;
}

.progress-bar {
    height: 8px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 4px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-orange {
    background: #fed7aa;
    color: #9a3412;
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .main-content.sidebar-open,
    .main-content.sidebar-hidden {
        margin-left: 0;
    }
}

@media (min-width: 1025px) {
    .sidebar.hidden {
        width: 0;
        transform: translateX(-100%);
        overflow: hidden;
        box-shadow: none;
    }
    .main-content.sidebar-hidden {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        grid-column: auto;
    }
    
    .analytics-table {
        font-size: 12px;
    }
    
    .analytics-table th,
    .analytics-table td {
        padding: 8px;
    }
}
/* ===== NOTIFICACIONES ===== */
.notification-bell {
    position: relative;
    display: inline-block;
    margin-right: 20px;
}

.notification-bell button {
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s;
}

.notification-bell button:hover {
    transform: scale(1.1);
}

.notification-bell button svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.notification-bell .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4757;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-dropdown {
    position: absolute;
    top: 45px;
    right: 0;
    width: 380px;
    max-height: 500px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notification-dropdown-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.notification-dropdown-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.header-actions {
    display: flex;
    gap: 5px;
}

.header-actions .small-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.header-actions .small-btn:hover {
    background: #e9ecef;
    color: #333;
}

.header-actions .small-btn.danger:hover {
    background: #ffe5e5;
    color: #d63031;
    border-color: #d63031;
}

.notification-dropdown-list {
    flex: 1;
    overflow-y: auto;
    max-height: 380px;
}

.notification-dropdown-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.notification-dropdown-item:hover {
    background: #f8f9fa;
}

.notification-dropdown-item.unread {
    background: #e3f2fd;
    border-left: 3px solid #1976d2;
}

.notification-dropdown-item .notif-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification-dropdown-item .notif-content {
    flex: 1;
    min-width: 0;
}

.notification-dropdown-item .notif-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-dropdown-item .notif-message {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-dropdown-item .notif-time {
    font-size: 12px;
    color: #999;
}

.notification-dropdown-item .delete-notif {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.notification-dropdown-item:hover .delete-notif {
    opacity: 1;
    color: #ff4757;
}

.notification-dropdown-item .delete-notif:hover {
    transform: scale(1.2);
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.notification-empty p {
    margin: 0;
    font-size: 14px;
}

.notification-dropdown-footer {
    padding: 10px 15px;
    text-align: center;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.view-all-link {
    font-size: 13px;
    color: #1976d2;
    text-decoration: none;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: #1565c0;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .notification-dropdown {
        width: 320px;
        right: -20px;
    }
}
/* --- fin de estilos extraídos de create.php --- */