/* ============================================
   SCI - Sistema de Comunicación Institucional
   Universidad Privada María Serrana (UPMS)
   ============================================ */

:root {
    --primary: #25604C;
    --primary-dark: #1a4536;
    --primary-light: #2d7359;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg-dark: #1a3a2f;
    --bg-darker: #0f2a1f;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

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

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

/* ---- LOGIN ---- */
.login-page {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container { width: 100%; max-width: 420px; padding: 20px; }

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

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

.login-logo { width: 80px; height: 80px; margin-bottom: 16px; }

.login-header h1 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-form .form-group { margin-bottom: 20px; }

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-light);
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: var(--font-family);
    transition: border-color 0.2s;
    background: var(--bg-white);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 96, 76, 0.1);
}

select.form-control { cursor: pointer; }

textarea.form-control { resize: vertical; min-height: 100px; }

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-check input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }

.form-check-inline-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.form-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.form-check-inline input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.form-check-inline label { font-size: 0.875rem; cursor: pointer; }

.form-text { font-size: 0.8rem; color: var(--text-light); margin-top: 4px; }

.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
    gap: 8px;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--primary); color: var(--text-white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--text-white); }

.btn-success { background: var(--success); color: var(--text-white); }
.btn-success:hover { background: #16a34a; color: var(--text-white); }

.btn-danger { background: var(--danger); color: var(--text-white); }
.btn-danger:hover { background: #dc2626; color: var(--text-white); }

.btn-secondary { background: var(--secondary); color: var(--text-white); }
.btn-secondary:hover { background: #475569; color: var(--text-white); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--text-white); }

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-block { width: 100%; }

.btn-group { display: flex; gap: 8px; }

.btn-group-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.btn-group-actions .btn {
    padding: 4px 8px;
}

.btn-group-actions .btn svg {
    display: block;
}

/* ---- ALERTS ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ---- ADMIN LAYOUT ---- */
.admin-page { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo { width: 40px; height: 40px; filter: brightness(0) invert(1); }

.sidebar-brand strong { display: block; font-size: 1.125rem; }
.sidebar-brand small { color: var(--text-light); font-size: 0.75rem; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    transition: all 0.2s;
    gap: 10px;
}

.nav-item:hover { background: rgba(255,255,255,0.1); color: var(--text-white); }
.nav-item.active { background: rgba(255,255,255,0.15); color: var(--text-white); border-left: 3px solid var(--success); }

.nav-icon { width: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { display: block; }

.nav-section {
    padding: 16px 20px 6px;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.6875rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info strong { display: block; font-size: 0.8125rem; }
.user-info small { color: var(--text-light); font-size: 0.6875rem; }

.btn-logout {
    color: rgba(255,255,255,0.5);
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
}
.btn-logout:hover { color: var(--danger); }

/* ---- MAIN CONTENT ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-bar {
    background: var(--bg-white);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    border: none;
    cursor: pointer;
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: var(--primary-dark);
}

.sidebar-toggle:active {
    transform: scale(0.98);
}

.sidebar-toggle .toggle-text {
    display: none;
}

.sidebar-toggle svg {
    flex-shrink: 0;
}

/* Botón flotante de retroceso (FAB) */
.fab-back {
    display: none; /* Solo visible en móvil */
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 90;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s;
}

.fab-back:hover {
    background: var(--bg-light);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.fab-back:active {
    transform: scale(0.98);
}

.fab-back svg {
    flex-shrink: 0;
}

.sidebar-overlay {
    display: none; /* Solo visible en móvil */
}

.page-title { font-size: 1.25rem; font-weight: 600; }

.top-bar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.user-name { font-size: 0.875rem; color: var(--text-secondary); }

.header-logo {
    display: none; /* Solo visible en móvil */
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.content-area { padding: 24px; }

/* Footer institucional */
.app-footer {
    display: none; /* Solo visible en móvil */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,0.95) 80%, rgba(255,255,255,0) 100%);
    padding: 16px 20px 12px;
    text-align: center;
    z-index: 80;
    pointer-events: none;
}

.footer-logo {
    height: 24px;
    width: auto;
    opacity: 0.7;
}

/* ---- CARDS ---- */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 { font-size: 1rem; font-weight: 600; }

.card-body { padding: 20px; }

/* ---- DASHBOARD STATS ---- */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--secondary);
}

.stat-card.stat-primary { border-left-color: var(--primary); }
.stat-card.stat-success { border-left-color: var(--success); }
.stat-card.stat-info { border-left-color: var(--info); }
.stat-card.stat-warning { border-left-color: var(--warning); }

.stat-number { font-size: 2rem; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 8px; }
.stat-link { font-size: 0.8125rem; color: var(--primary); }

.quick-actions { margin-bottom: 24px; }

/* ---- NEW DASHBOARD ---- */
.welcome-header {
    margin-bottom: 24px;
}

.welcome-text h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: capitalize;
}

/* Quick Grid */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.quick-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.quick-item:active {
    transform: scale(0.98);
}

.quick-icon {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: white;
}

.quick-icon-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); }
.quick-icon-success { background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%); }
.quick-icon-warning { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.quick-icon-info { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); }
.quick-icon-accent { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); }

.quick-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.quick-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.quick-count {
    font-size: 0.75rem;
    color: var(--text-light);
}

.quick-item-action {
    border: 2px dashed var(--border-color);
    background: transparent;
    box-shadow: none;
}

.quick-item-action:hover {
    border-color: var(--primary);
    background: var(--bg-white);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}

.section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-link {
    font-size: 0.8125rem;
    color: var(--primary);
    font-weight: 500;
}

/* Recent List */
.recent-list {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.recent-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    transition: background 0.2s;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item:hover {
    background: var(--bg-light);
}

.recent-item:active {
    background: #e2e8f0;
}

.recent-item.unread {
    background: #f0fdf4;
    border-left: 3px solid var(--primary);
}

.recent-item.unread .recent-sender {
    font-weight: 700;
    color: var(--primary-dark, #1a4536);
}

.recent-item.unread .recent-subject {
    color: var(--text-primary);
    font-weight: 500;
}

.recent-item.read {
    opacity: 0.7;
}

.recent-item.read .recent-sender {
    font-weight: 400;
}

.recent-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    text-transform: uppercase;
}

.recent-status.status-new {
    background: var(--primary);
    color: white;
}

.recent-status.status-read {
    background: #e2e8f0;
    color: #64748b;
}

.recent-indicator {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}

.recent-indicator.badge-alta { background: var(--danger); }
.recent-indicator.badge-media { background: var(--warning); }
.recent-indicator.badge-normal { background: var(--primary); }
.recent-indicator.badge-baja { background: var(--secondary); }

.recent-content {
    flex: 1;
    min-width: 0;
}

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

.recent-sender {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-date {
    font-size: 0.75rem;
    color: var(--text-light);
    flex-shrink: 0;
    margin-left: 8px;
}

.recent-subject {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    text-transform: uppercase;
}

.recent-arrow {
    color: var(--text-light);
    transform: rotate(180deg);
    flex-shrink: 0;
}

/* Empty Welcome */
.empty-welcome {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-welcome-icon {
    color: var(--text-light);
    margin-bottom: 16px;
}

.empty-welcome p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

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

.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover { background: #f1f5f9; }

.row-unread { background: #f0fdf4 !important; font-weight: 500; }
.row-unread:hover { background: #dcfce7 !important; }

.table-responsive {
    width: 100%;
}

/* ---- BADGES ---- */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-baja { background: #e2e8f0; color: var(--text-secondary); }
.badge-normal { background: #dbeafe; color: #1e40af; }
.badge-alta { background: #fed7aa; color: #c2410c; }
.badge-urgente { background: #fecaca; color: #991b1b; }

.badge-success { background: #bbf7d0; color: #166534; }
.badge-danger { background: #fecaca; color: #991b1b; }
.badge-info { background: #bfdbfe; color: #1e40af; }
.badge-warning { background: #fde68a; color: #92400e; }

.badge-programador { background: #1a3a2f; color: white; }
.badge-director_general { background: var(--primary); color: white; }
.badge-director_carrera { background: var(--primary-light); color: white; }
.badge-coordinador { background: var(--info); color: white; }
.badge-docente { background: var(--warning); color: white; }
.badge-estudiante { background: var(--secondary); color: white; }

/* ---- PAGE HEADER ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h3 { font-size: 1.125rem; font-weight: 600; }

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon { margin-bottom: 12px; color: var(--text-light); }
.empty-state-icon svg { display: inline-block; }
.empty-state p { margin-bottom: 16px; }

/* ---- PAGINATION ---- */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }

.pagination a, .pagination span {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.pagination a:hover { background: var(--bg-light); }
.pagination .active { background: var(--primary); color: white; border-color: var(--primary); }

/* ---- INBOX SPECIFIC ---- */
.inbox-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.inbox-filters .btn.active { background: var(--primary); color: white; }

.inbox-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    gap: 12px;
    cursor: pointer;
}

.inbox-item:hover { background: #f1f5f9; }
.inbox-item.unread { background: #f0fdf4; font-weight: 500; }
.inbox-item .sender { min-width: 180px; font-size: 0.875rem; }
.inbox-item .subject { flex: 1; font-size: 0.875rem; }
.inbox-item .date { color: var(--text-light); font-size: 0.8125rem; min-width: 120px; text-align: right; }

/* ---- DETAIL VIEW (Comunicado) ---- */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-date {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.detail-action {
    margin: 0;
}

.detail-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.detail-subject {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.detail-sender {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sender-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.sender-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sender-info strong {
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.sender-info span {
    font-size: 0.75rem;
    color: var(--text-light);
}

.detail-message {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.detail-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
}

.detail-section-title svg {
    flex-shrink: 0;
}

/* Responses list */
.responses-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.response-item {
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.response-header strong {
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.response-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.response-body {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ---- PRIORITY TOGGLES ---- */

.priority-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.priority-toggle {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.priority-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Baja - gris/azul */
.priority-baja { border-color: #94a3b8; }
.priority-baja:hover { background: #f1f5f9; color: #475569; }
.priority-baja.active { background: #64748b; border-color: #64748b; color: white; box-shadow: 0 2px 4px rgba(100,116,139,0.3); }

/* Normal - azul */
.priority-normal { border-color: #3b82f6; }
.priority-normal:hover { background: #eff6ff; color: #1e40af; }
.priority-normal.active { background: #3b82f6; border-color: #3b82f6; color: white; box-shadow: 0 2px 4px rgba(59,130,246,0.3); }

/* Alta - naranja */
.priority-alta { border-color: #f59e0b; }
.priority-alta:hover { background: #fffbeb; color: #b45309; }
.priority-alta.active { background: #f59e0b; border-color: #f59e0b; color: white; box-shadow: 0 2px 4px rgba(245,158,11,0.3); }

/* Urgente - rojo */
.priority-urgente { border-color: #ef4444; }
.priority-urgente:hover { background: #fef2f2; color: #b91c1c; }
.priority-urgente.active { background: #ef4444; border-color: #ef4444; color: white; box-shadow: 0 2px 4px rgba(239,68,68,0.3); }

/* ---- OPTION TOGGLES (compose/edit) ---- */

/* Semestres: barra compacta para arrastre */
#semestres-list.option-toggle-group {
    gap: 0;
}

#semestres-list .option-toggle {
    border-radius: 0;
    border-right-width: 1px;
    padding: 8px 14px;
    min-width: 44px;
    justify-content: center;
}

#semestres-list .option-toggle:first-child {
    border-radius: 20px 0 0 20px;
}

#semestres-list #toggle-sem11 {
    border-radius: 0 20px 20px 0;
    border-right-width: 2px;
}

#semestres-list [data-key="sem_10"] {
    border-radius: 0 20px 20px 0;
    border-right-width: 2px;
}

#semestres-list .option-toggle + .option-toggle {
    border-left: none;
}

#semestres-list .option-toggle.active + .option-toggle:not(.active) {
    border-left: 2px solid var(--border-color);
}

#semestres-list .option-toggle:not(.active) + .option-toggle.active {
    border-left: none;
}


.option-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.option-toggle {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.option-toggle:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: #f0fdf4;
}

.option-toggle.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 96, 76, 0.3);
}

.option-toggle.active:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

/* Custom option add */
.custom-option-add {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 6px;
    max-width: 400px;
}

.custom-option-add .form-control {
    flex: 1;
    font-size: 0.8125rem;
    padding: 6px 12px;
}

/* Remove X on custom toggles */
.remove-custom {
    margin-left: 6px;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
    font-weight: 700;
}

.remove-custom:hover {
    opacity: 1;
}

/* ---- RESPONSE BUTTONS ---- */

.response-buttons-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.btn-response {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-white);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.btn-response:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-response:active {
    transform: translateY(0);
}

.btn-response:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-response-recibido {
    border-color: #3b82f6;
    color: #1e40af;
}
.btn-response-recibido:hover {
    background: #dbeafe;
}

.btn-response-confirmo {
    border-color: #22c55e;
    color: #166534;
}
.btn-response-confirmo:hover {
    background: #dcfce7;
}

.btn-response-asistire {
    border-color: var(--primary);
    color: var(--primary-dark);
}
.btn-response-asistire:hover {
    background: #d1fae5;
}

.btn-response-no_asistire {
    border-color: #f59e0b;
    color: #92400e;
}
.btn-response-no_asistire:hover {
    background: #fef3c7;
}

.btn-response-custom {
    border-color: #8b5cf6;
    color: #5b21b6;
}
.btn-response-custom:hover {
    background: #ede9fe;
}

.badge-response-type {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 10px;
    background: #e0e7ff;
    color: #3730a3;
    vertical-align: middle;
    margin-left: 4px;
}

.response-stats-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius);
}

.response-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.response-stat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.responses-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ---- RESPONSIVE & PWA ---- */

/* Tablet */
@media (max-width: 1024px) {
    .content-area { padding: 16px; }
    .card-body { padding: 16px; }
    .card-header { padding: 12px 16px; }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }

    html {
        /* Prevenir zoom en inputs en iOS */
        -webkit-text-size-adjust: 100%;
        height: auto;
        min-height: 100%;
        overflow-y: auto;
    }

    body {
        /* Safe area para notch/home indicator */
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        -webkit-overflow-scrolling: touch;
        height: auto;
        min-height: 100%;
        overflow-y: auto;
    }

    .admin-page {
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
    }

    .main-content {
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
    }

    /* Sidebar móvil */
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    .sidebar.open { transform: translateX(0); }

    /* Overlay cuando sidebar está abierto */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
        opacity: 0;
        transition: opacity 0.3s;
    }
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Top bar móvil */
    .sidebar-toggle {
        display: flex;
    }

    .sidebar-toggle .toggle-text {
        display: inline;
    }

    .main-content { margin-left: 0; }

    /* Botón flotante de retroceso visible */
    .fab-back {
        display: flex;
        bottom: calc(20px + env(safe-area-inset-bottom));
        left: calc(16px + env(safe-area-inset-left));
    }

    /* Content area móvil */
    .content-area {
        padding: 16px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .top-bar {
        padding: 12px 16px;
        gap: 12px;
        position: sticky;
        top: 0;
    }

    .page-title {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    .top-bar-right {
        display: flex;
        gap: 0;
    }

    .top-bar-right .user-name {
        display: none; /* Ocultar nombre en móvil */
    }

    .header-logo {
        display: block;
    }

    /* Footer institucional visible en móvil */
    .app-footer {
        display: block;
    }

    /* Detail view móvil */
    .detail-header {
        margin-bottom: 12px;
    }

    .detail-card {
        padding: 14px;
        margin-bottom: 10px;
        border-radius: var(--radius);
    }

    .detail-subject {
        font-size: 1rem;
    }

    .sender-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    .detail-message {
        font-size: 0.875rem;
    }

    .response-item {
        padding: 10px;
    }

    .priority-toggle-group {
        gap: 6px;
    }

    .priority-toggle {
        padding: 6px 14px;
        font-size: 0.75rem;
    }

    .option-toggle-group {
        gap: 6px;
    }

    .option-toggle {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .response-buttons-group {
        flex-direction: column;
    }

    .btn-response {
        width: 100%;
    }

    .response-stats-summary {
        gap: 8px;
    }

    .response-stat-item {
        font-size: 0.75rem;
    }

    /* Ajustar padding del contenido para el footer */
    .content-area {
        padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important;
    }

    /* Cards compactas */
    .card {
        border-radius: var(--radius);
        margin-bottom: 12px;
    }

    .card-header {
        padding: 12px 14px;
    }

    .card-header h3 {
        font-size: 0.9375rem;
    }

    .card-body {
        padding: 14px;
    }

    /* Page header */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }

    .page-header h3 {
        font-size: 1rem;
    }

    .page-header .btn-group {
        display: flex;
        width: 100%;
    }

    .page-header .btn-group .btn {
        flex: 1;
        justify-content: center;
    }

    /* Dashboard móvil */
    .welcome-header {
        margin-bottom: 20px;
    }

    .welcome-text h2 {
        font-size: 1.25rem;
    }

    .quick-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .quick-item {
        padding: 16px 12px;
    }

    .quick-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
    }

    .quick-label {
        font-size: 0.8125rem;
    }

    .quick-count {
        font-size: 0.6875rem;
    }

    .section-header {
        margin-bottom: 10px;
    }

    .section-header h3 {
        font-size: 0.9375rem;
    }

    .recent-item {
        padding: 12px 14px;
        gap: 10px;
    }

    .recent-sender {
        font-size: 0.8125rem;
    }

    .recent-subject {
        font-size: 0.75rem;
    }

    .recent-indicator {
        width: 3px;
        height: 36px;
    }

    .empty-welcome {
        padding: 40px 20px;
    }

    /* Stats compactas (legacy) */
    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
        border-radius: var(--radius);
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .stat-link {
        font-size: 0.75rem;
    }

    /* Formularios */
    .form-row { flex-direction: column; gap: 0; }

    .form-control {
        font-size: 16px; /* Previene zoom en iOS */
        padding: 12px 14px;
    }

    .form-group label {
        font-size: 0.8125rem;
    }

    /* Tablas responsivas */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -14px;
        padding: 0 14px;
    }

    .table {
        font-size: 0.8125rem;
        min-width: 500px;
    }

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

    /* Inbox items - estilo lista nativa */
    .inbox-item {
        padding: 12px 14px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .inbox-item .sender {
        min-width: auto;
        width: 100%;
        font-weight: 600;
        font-size: 0.8125rem;
    }

    .inbox-item .subject {
        width: 100%;
        font-size: 0.8125rem;
        color: var(--text-secondary);
    }

    .inbox-item .date {
        min-width: auto;
        font-size: 0.75rem;
        position: absolute;
        right: 14px;
        top: 12px;
    }

    .inbox-item {
        position: relative;
    }

    /* Botones */
    .btn {
        padding: 12px 16px;
        font-size: 0.875rem;
    }

    .btn-sm {
        padding: 8px 12px;
        font-size: 0.8125rem;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    .btn-group-actions {
        gap: 6px;
    }

    .btn-group-actions .btn {
        padding: 8px 10px;
    }

    /* Badges */
    .badge {
        font-size: 0.6875rem;
        padding: 2px 6px;
    }

    /* Alerts */
    .alert {
        padding: 10px 12px;
        font-size: 0.8125rem;
        margin: 0 0 12px;
        border-radius: var(--radius);
    }

    /* Empty state */
    .empty-state {
        padding: 40px 20px;
    }

    .empty-state-icon svg {
        width: 40px;
        height: 40px;
    }

    /* Attachments */
    .attachment-item {
        padding: 10px 12px;
    }

    .attachment-name {
        font-size: 0.8125rem;
    }

    /* Quick actions móvil */
    .quick-actions .btn-group {
        flex-direction: column;
    }

    .quick-actions .btn {
        width: 100%;
    }

    /* Mensajes - hyphens en móvil */
    .message-content {
        hyphens: auto;
    }

    /* Pagination móvil */
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }

    .pagination a, .pagination span {
        padding: 8px 10px;
        font-size: 0.8125rem;
    }
}

/* PWA Standalone mode — solo ajustes de safe area, sin tocar scroll */
@media (display-mode: standalone) {

    /* Ajustes específicos cuando está instalada como PWA */
    .top-bar {
        padding-top: calc(12px + env(safe-area-inset-top));
        flex-shrink: 0;
    }

    .login-page {
        padding-top: env(safe-area-inset-top);
    }
}

/* Small phones */
@media (max-width: 375px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .stat-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
    }

    .stat-number {
        font-size: 1.25rem;
        order: 2;
        margin-left: auto;
    }

    .stat-label {
        margin-bottom: 0;
        order: 1;
    }

    .stat-link {
        display: none;
    }
}

/* ---- UTILITY ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

.list-unstyled {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-unstyled li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-unstyled li:last-child {
    border-bottom: none;
}

/* ---- MESSAGE CONTENT ---- */
.message-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}

/* ---- ATTACHMENTS ---- */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    gap: 12px;
    max-width: 100%;
    overflow: hidden;
}

.attachment-item:hover {
    background: #e2e8f0;
    border-color: var(--primary);
    color: var(--text-primary);
}

.attachment-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.attachment-name {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    font-size: 0.75rem;
    color: var(--text-light);
}

.attachment-download {
    flex-shrink: 0;
    color: var(--text-light);
    transition: color 0.2s;
}

.attachment-item:hover .attachment-download {
    color: var(--primary);
}

/* ============================================================
   DISEÑO NIEVE — Overrides (Notion/Linear style)
   Para revertir: eliminar desde esta línea hasta el final
   ============================================================ */

/* --- Sidebar blanco --- */
.sidebar {
    background: #ffffff !important;
    color: #111111 !important;
    border-right: 1px solid #e8e8e8 !important;
}

.sidebar-header {
    border-bottom: 1px solid #e8e8e8 !important;
}

.sidebar-logo {
    filter: none !important;
}

.sidebar-brand small {
    color: #aaaaaa !important;
}

.sidebar-footer {
    border-top: 1px solid #e8e8e8 !important;
}

/* --- Nav items --- */
.nav-item {
    color: #555555 !important;
    border-radius: 6px !important;
    margin: 1px 8px !important;
    padding: 8px 12px !important;
}

.nav-item:hover {
    background: #f0f0f0 !important;
    color: #111111 !important;
}

.nav-item.active {
    background: #f0f0f0 !important;
    color: #111111 !important;
    border-left: none !important;
    font-weight: 600 !important;
}

.nav-item.active svg,
.nav-item.active .nav-icon svg {
    color: #25604C !important;
    stroke: #25604C !important;
}

.nav-section {
    color: #aaaaaa !important;
}

.nav-badge {
    background: #2563eb !important;
}

/* --- Logout --- */
.btn-logout {
    color: #555555 !important;
}
.btn-logout:hover {
    color: #dc2626 !important;
    background: transparent !important;
}

/* --- Topbar --- */
.top-bar {
    box-shadow: none !important;
    border-bottom: 1px solid #e8e8e8 !important;
}

/* --- Sidebar toggle (mobile) --- */
.sidebar-toggle {
    background: #111111 !important;
}
.sidebar-toggle:hover {
    background: #333333 !important;
}

/* --- FAB back button --- */
.fab-back {
    box-shadow: 0 1px 4px rgba(0,0,0,.12) !important;
}

/* --- Stat cards: sin border-left de color, sin sombra --- */
.stat-card {
    box-shadow: none !important;
    border: 1px solid #e8e8e8 !important;
    border-left: 1px solid #e8e8e8 !important;
    border-left-width: 1px !important;
    border-radius: 6px !important;
}
.stat-card.stat-primary,
.stat-card.stat-success,
.stat-card.stat-info,
.stat-card.stat-warning {
    border-left: 1px solid #e8e8e8 !important;
}

.stat-number {
    font-size: 2.4rem !important;
    font-weight: 800 !important;
    letter-spacing: -1.5px !important;
    line-height: 1 !important;
}

/* --- Quick actions: sin gradientes, iconos outlined --- */
.quick-item {
    box-shadow: none !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 6px !important;
    transition: border-color 0.15s !important;
}
.quick-item:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: #cccccc !important;
}
.quick-item-action {
    background: #ffffff !important;
}

.quick-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 6px !important;
}
.quick-icon-primary { background: #f0fdf4 !important; color: #25604C !important; border: 1px solid #86efac !important; }
.quick-icon-success { background: #f0fdf4 !important; color: #166534 !important; border: 1px solid #86efac !important; }
.quick-icon-warning { background: #fffbeb !important; color: #92400e !important; border: 1px solid #fde68a !important; }
.quick-icon-info    { background: #eff6ff !important; color: #1e40af !important; border: 1px solid #93c5fd !important; }
.quick-icon-accent  { background: #eff6ff !important; color: #1e40af !important; border: 1px solid #93c5fd !important; }
.quick-icon svg { color: inherit !important; stroke: currentColor !important; }

/* --- Recent list / inbox --- */
.recent-list {
    box-shadow: none !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 6px !important;
}

.recent-item.unread {
    background: #ffffff !important;
    border-left: 2px solid #2563eb !important;
}
.recent-item.unread .recent-sender {
    color: #111111 !important;
}
.recent-item:hover {
    background: #f5f5f5 !important;
}

.recent-status.status-new {
    background: #ffffff !important;
    border: 1px solid #93c5fd !important;
    color: #1e40af !important;
}
.recent-status.status-read {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    color: #555555 !important;
}

/* --- Sender avatar: plano sin gradiente --- */
.sender-avatar {
    background: #25604C !important;
}

/* --- Cards generales --- */
.card {
    box-shadow: none !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 6px !important;
}
.detail-card {
    box-shadow: none !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 6px !important;
}
.empty-welcome {
    box-shadow: none !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 6px !important;
}

/* --- Buttons --- */
.btn {
    box-shadow: none !important;
    border-radius: 6px !important;
}
.btn-primary {
    background-color: #111111 !important;
    border-color: #111111 !important;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #333333 !important;
    border-color: #333333 !important;
    box-shadow: none !important;
}
.btn-secondary {
    background-color: transparent !important;
    border-color: #e8e8e8 !important;
    color: #111111 !important;
}
.btn-secondary:hover {
    background-color: #f0f0f0 !important;
    border-color: #cccccc !important;
    color: #111111 !important;
}
.btn-success  { background-color: #166534 !important; border-color: #166534 !important; }
.btn-danger   { background-color: #dc2626 !important; border-color: #dc2626 !important; }
.btn-warning  { background-color: #92400e !important; border-color: #92400e !important; }
.btn-info     { background-color: #1e40af !important; border-color: #1e40af !important; }

/* --- Badges / estado --- */
.badge, .status-badge {
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    border-radius: 4px !important;
    border: 1px solid !important;
    background: #ffffff !important;
}
.badge-alta    { background: #ffffff !important; border-color: #fca5a5 !important; color: #991b1b !important; }
.badge-urgente { background: #ffffff !important; border-color: #fca5a5 !important; color: #991b1b !important; }
.badge-media   { background: #ffffff !important; border-color: #fde68a !important; color: #92400e !important; }
.badge-normal  { background: #ffffff !important; border-color: #e5e7eb !important; color: #374151 !important; }
.badge-baja    { background: #ffffff !important; border-color: #e5e7eb !important; color: #374151 !important; }
/* Monitoreo / logs badges */
.badge-error   { background: #fef2f2 !important; border-color: #fca5a5 !important; color: #dc2626 !important; }
.badge-warning { background: #fffbeb !important; border-color: #fde68a !important; color: #d97706 !important; }
.badge-info    { background: #eff6ff !important; border-color: #93c5fd !important; color: #2563eb !important; }
.badge-debug   { background: #f1f5f9 !important; border-color: #cbd5e1 !important; color: #64748b !important; }

/* --- Alerts --- */
.alert {
    border-radius: 6px !important;
}
.alert-danger  { background: #fef2f2 !important; color: #991b1b !important; border-color: #fca5a5 !important; }
.alert-success { background: #f0fdf4 !important; color: #166534 !important; border-color: #86efac !important; }
.alert-warning { background: #fffbeb !important; color: #92400e !important; border-color: #fde68a !important; }
.alert-info    { background: #eff6ff !important; color: #1e40af !important; border-color: #93c5fd !important; }

/* --- Tabla --- */
.table thead th {
    background: #f9f9f9 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #aaaaaa !important;
    border-bottom: 1px solid #e8e8e8 !important;
}
.table tbody tr:hover td { background: #f5f5f5 !important; }
.table-card {
    box-shadow: none !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 6px !important;
}

/* --- Form controls --- */
.form-control, .form-select {
    border-color: #e8e8e8 !important;
    border-radius: 6px !important;
}
.form-control:focus, .form-select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.08) !important;
}

/* --- Pagination --- */
.pagination .page-link {
    border-color: #e8e8e8 !important;
    color: #555555 !important;
    border-radius: 6px !important;
}
.pagination .page-item.active .page-link {
    background-color: #111111 !important;
    border-color: #111111 !important;
    color: #ffffff !important;
}

/* --- Login page --- */
.login-page {
    background: #f9f9f9 !important;
    font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.login-card {
    border: 1px solid #e8e8e8 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    padding: 36px 40px 32px !important;
}

.login-logo {
    width: 56px !important;
    height: 56px !important;
    filter: none !important;
}

.login-header h1 {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #111111 !important;
    letter-spacing: -0.2px !important;
}

.login-header p {
    color: #aaaaaa !important;
    font-size: 0.8125rem !important;
}

.login-form label {
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: #555555 !important;
}

.login-form .form-control {
    border: 1px solid #e8e8e8 !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    height: 38px !important;
    box-shadow: none !important;
}

.login-form .form-control:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.08) !important;
}

.login-footer small {
    color: #aaaaaa !important;
    font-size: 0.6875rem !important;
}

/* ============================================================
   FIN DISEÑO NIEVE
   ============================================================ */
