/* ============================================
   VARIABLES GLOBALES
   ============================================ */
:root {
    --primary: #1a1a2e;
    --primary-light: #16213e;
    --secondary: #0f3460;
    --accent: #00a1ab;
    --accent-light: #00d4e0;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255,255,255,0.06);
    --sidebar-active: rgba(0, 161, 171, 0.15);
    --text-light: rgba(255,255,255,0.85);
    --text-muted: rgba(255,255,255,0.5);
    --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --border: #e5e7eb;
    --bg-body: #f0f4f8;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --navbar-height: 60px;
    --transition-speed: 0.28s;
    --ease: cubic-bezier(.4, 0, .2, 1);
}

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

body {
    background: var(--bg-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   LAYOUT PRINCIPAL (flex: sidebar + main)
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ============================================
   SIDEBAR
   ============================================ */
.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--sidebar-bg);
    color: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    z-index: 1050;
    box-shadow: 2px 0 20px rgba(0,0,0,0.15);
    transition: width var(--transition-speed) var(--ease),
                min-width var(--transition-speed) var(--ease),
                transform var(--transition-speed) var(--ease);
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.22) transparent;
}

/* ============================================
   SCROLLBAR SIDEBAR (más ancha y visible)
   ============================================ */
.app-sidebar::-webkit-scrollbar {
    width: 10px;
}
.app-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
}
.app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.app-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 224, 0.55);
    background-clip: content-box;
}

/* Colapsado */
.app-layout.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
}

.app-layout.sidebar-collapsed .sidebar-header .logo-text,
.app-layout.sidebar-collapsed .sidebar-user .user-info,
.app-layout.sidebar-collapsed .sidebar-nav .nav-label,
.app-layout.sidebar-collapsed .sidebar-nav .nav-link > span,
.app-layout.sidebar-collapsed .sidebar-nav .nav-link .nav-ready-dot,
.app-layout.sidebar-collapsed .sidebar-nav .nav-link .nav-soon-dot {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity .2s ease;
}

.app-layout.sidebar-collapsed .sidebar-header .logo,
.app-layout.sidebar-collapsed .sidebar-user,
.app-layout.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center;
}

.app-layout.sidebar-collapsed .sidebar-nav .nav-link {
    padding: 12px 0;
    position: relative;
}

.app-layout.sidebar-collapsed .sidebar-nav .nav-link i {
    font-size: 1.15rem;
    margin: 0;
}

/* Tooltip colapsado */
.app-layout.sidebar-collapsed .sidebar-nav .nav-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    z-index: 1200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.app-layout.sidebar-collapsed .sidebar-nav .nav-link:hover::after {
    opacity: 1;
}

/* Contenido interno del sidebar */
.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.sidebar-header .logo .logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}
.sidebar-header .logo .logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    white-space: nowrap;
}
.sidebar-header .logo .logo-text span { color: var(--accent); }

.sidebar-user {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-user .avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user .user-role {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav { flex: 1; padding: 12px 12px 20px; }
.sidebar-nav .nav-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 8px 12px 6px;
    font-weight: 700;
    white-space: nowrap;
}

/* NAV LINK */
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2px;
    position: relative;
    line-height: 1.4;
}
.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color 0.2s;
}
.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); color: white; }
.sidebar-nav .nav-link:hover i { color: white; }
.sidebar-nav .nav-link.active { background: var(--sidebar-active); color: white; }
.sidebar-nav .nav-link.active i { color: var(--accent); }

/* BADGE */
.sidebar-nav .nav-link .badge-nav {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    padding: 1px 8px;
    border-radius: 50px;
    font-weight: 600;
    flex-shrink: 0;
    line-height: 1.4;
    min-width: 20px;
    text-align: center;
}

/* DIVIDER */
.sidebar-nav .nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 8px 12px;
}

/* LOGOUT */
.sidebar-nav .nav-link.logout-btn { color: var(--danger); opacity: 0.7; }
.sidebar-nav .nav-link.logout-btn:hover { background: rgba(220, 53, 69, 0.15); opacity: 1; }
.sidebar-nav .nav-link.logout-btn i { color: var(--danger); }

/* DOTS DE ESTADO */
.sidebar-nav .nav-link .nav-ready-dot {
    display: inline-block;
    width: 8px; height: 8px;
    min-width: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    animation: pulse-ready 2s ease-in-out infinite;
}
.sidebar-nav .nav-link .nav-soon-dot {
    display: inline-block;
    width: 8px; height: 8px;
    min-width: 8px;
    background-color: #9ca3af;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0.6;
}
.sidebar-nav .nav-link .badge-nav ~ .nav-ready-dot,
.sidebar-nav .nav-link .badge-nav ~ .nav-soon-dot {
    margin-left: 0.5rem;
}
.sidebar-nav .nav-link.nav-item-soon { opacity: 0.75; }
.sidebar-nav .nav-link.nav-item-soon:hover { opacity: 1; }

@keyframes pulse-ready {
    0%, 100% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2); }
    50%      { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08); }
}

/* ============================================
   OVERLAY (solo móvil)
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity var(--transition-speed) var(--ease);
    cursor: pointer;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================
   COLUMNA DERECHA
   ============================================ */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-speed) var(--ease);
}

/* ============================================
   NAVBAR
   ============================================ */
.app-navbar {
    position: sticky;
    top: 0;
    z-index: 900;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    transition: all var(--transition-speed) var(--ease);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #374151;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background .2s;
}
.navbar-toggle:hover { background: #f3f4f6; }

.navbar-title {
    flex: 1;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #4b5563;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s;
}
.navbar-icon-btn:hover { background: #f3f4f6; }
.navbar-icon-btn .badge-nav {
    position: absolute;
    top: 2px; right: 2px;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* ============================================
   POPPER DE PERFIL
   ============================================ */
.profile-popper { position: relative; }

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s;
}
.profile-trigger:hover { background: #f3f4f6; }

.avatar-sm {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: .9rem;
}

.profile-name {
    font-weight: 500;
    font-size: .9rem;
    color: #374151;
    white-space: nowrap;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 290px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    border: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all .2s ease;
    z-index: 1100;
}
.profile-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-header {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
}
.avatar-lg {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.popper-name  { font-weight: 600; color: #111827; font-size: .95rem; }
.popper-rol   { font-size: .8rem; color: #6b7280; }
.popper-email { font-size: .75rem; color: #9ca3af; word-break: break-all; }

.profile-body { padding: 6px; }
.profile-body a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: .88rem;
    transition: background .15s;
}
.profile-body a:hover { background: #f3f4f6; color: var(--primary); }
.profile-body a i { width: 18px; text-align: center; color: #6b7280; }

.profile-footer {
    padding: 10px;
    border-top: 1px solid #f3f4f6;
}
.btn-logout {
    width: 100%;
    padding: 9px;
    background: #fef2f2;
    color: #dc2626;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: .88rem;
    cursor: pointer;
    transition: background .2s;
}
.btn-logout:hover { background: #fee2e2; }

/* ============================================
   CONTENIDO
   ============================================ */
.app-content {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
}

/* ============================================
   TOP BAR
   ============================================ */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.top-bar .page-title { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin: 0; }
.top-bar .page-title small { font-size: 0.85rem; font-weight: 400; color: #94a3b8; }
.top-bar .top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.top-bar .top-actions .btn-action { background: white; border: none; border-radius: 10px; padding: 8px 16px; font-size: 0.85rem; font-weight: 500; color: #1e293b; box-shadow: var(--card-shadow); transition: all 0.2s; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.top-bar .top-actions .btn-action:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.top-bar .top-actions .btn-action i { font-size: 0.9rem; }
.top-bar .top-actions .btn-action.primary { color: var(--primary); }
.top-bar .top-actions .btn-action.success { color: var(--success); }
.top-bar .top-actions .btn-action.warning { color: var(--warning); }
.top-bar .top-actions .btn-action.danger { color: var(--danger); }
.top-bar .top-actions .btn-action.info { color: var(--info); }

/* ============================================
   STAT CARDS
   ============================================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: 16px; padding: 20px; box-shadow: var(--card-shadow); transition: all 0.3s; cursor: pointer; border-left: 4px solid var(--accent); }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.stat-card .stat-header { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-card .stat-number { font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1.2; }
.stat-card .stat-label { font-size: 0.8rem; color: #94a3b8; font-weight: 500; }
.stat-card .stat-icon { font-size: 1.8rem; opacity: 0.2; }
.stat-card .stat-change { font-size: 0.7rem; font-weight: 600; margin-top: 6px; display: inline-block; padding: 2px 10px; border-radius: 50px; }
.stat-card .stat-change.up { background: #d4edda; color: #155724; }
.stat-card .stat-change.down { background: #f8d7da; color: #721c24; }
.stat-card.blue { border-left-color: #3b82f6; }
.stat-card.green { border-left-color: #22c55e; }
.stat-card.yellow { border-left-color: #f59e0b; }
.stat-card.purple { border-left-color: #8b5cf6; }
.stat-card.red { border-left-color: #ef4444; }
.stat-card.teal { border-left-color: #14b8a6; }
.stat-card.orange { border-left-color: #f97316; }

/* ============================================
   ACTION GRID
   ============================================ */
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 12px; margin-bottom: 24px; }
.action-card { background: white; border-radius: 12px; padding: 14px 10px; text-align: center; cursor: pointer; transition: all 0.2s; box-shadow: var(--card-shadow); border: 1px solid transparent; }
.action-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.action-card .action-icon { font-size: 1.5rem; color: var(--primary); display: block; margin-bottom: 4px; }
.action-card .action-label { font-size: 0.7rem; font-weight: 600; color: #1e293b; }

/* ============================================
   CARDS MODERNAS
   ============================================ */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 24px; }
.card-modern { background: white; border-radius: 16px; padding: 20px; box-shadow: var(--card-shadow); }
.card-modern .card-title { font-size: 0.9rem; font-weight: 700; color: var(--primary); margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.card-modern .card-title .badge-count { background: #eef2ff; color: var(--primary); font-size: 0.7rem; padding: 2px 10px; border-radius: 50px; }

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress-item { margin-bottom: 12px; }
.progress-item .progress-header { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 500; color: #1e293b; margin-bottom: 4px; }
.progress-item .progress-bar-custom { height: 6px; background: #e2e8f0; border-radius: 10px; overflow: hidden; }
.progress-item .progress-bar-custom .fill { height: 100%; border-radius: 10px; transition: width 0.6s ease; }
.fill.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.fill.green { background: linear-gradient(90deg, #22c55e, #4ade80); }
.fill.purple { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.fill.orange { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fill.red { background: linear-gradient(90deg, #ef4444, #f87171); }
.fill.teal { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }

/* ============================================
   ACTIVITY ITEMS
   ============================================ */
.activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.activity-item:last-child { border-bottom: none; }
.activity-item .activity-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.activity-item .activity-icon.blue { background: #dbeafe; color: #3b82f6; }
.activity-item .activity-icon.green { background: #dcfce7; color: #22c55e; }
.activity-item .activity-icon.purple { background: #ede9fe; color: #8b5cf6; }
.activity-item .activity-icon.orange { background: #fef3c7; color: #f59e0b; }
.activity-item .activity-icon.red { background: #fee2e2; color: #ef4444; }
.activity-item .activity-icon.teal { background: #ccfbf1; color: #0d9488; }
.activity-item .activity-content { flex: 1; }
.activity-item .activity-content .activity-text { font-size: 0.85rem; color: #1e293b; }
.activity-item .activity-content .activity-text strong { color: var(--primary); }
.activity-item .activity-content .activity-time { font-size: 0.7rem; color: #94a3b8; }

/* ============================================
   TOAST
   ============================================ */
.toast-notify { position: fixed; bottom: 24px; right: 24px; z-index: 9999; min-width: 280px; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); padding: 14px 20px; display: flex; align-items: center; gap: 12px; animation: slideUp 0.3s ease; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============================================
   LOADING
   ============================================ */
.loading-container { text-align: center; padding: 60px 20px; }
.loading-spinner { width: 44px; height: 44px; border: 4px solid #f3f3f3; border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ============================================
   MODALS
   ============================================ */
.modal-content { border: none; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.2); }
.modal-header { border: none; padding: 18px 24px; }
.modal-body { padding: 24px; }
.modal-footer { border: none; padding: 16px 24px; background: #f8fafc; }

/* ============================================
   FORMS
   ============================================ */
.form-control, .form-select { border-radius: 10px; border: 1.5px solid #e2e8f0; transition: all 0.2s; padding: 10px 14px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(30, 60, 114, 0.1); }
.btn-gradient { background: linear-gradient(135deg, var(--primary), var(--secondary)); border: none; color: white; border-radius: 50px; padding: 8px 22px; font-weight: 600; transition: all 0.3s; cursor: pointer; }
.btn-gradient:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(26, 26, 46, 0.3); color: white; }
.btn-gradient-success { background: linear-gradient(135deg, #28a745, #20c997); border: none; color: white; border-radius: 50px; padding: 8px 22px; font-weight: 600; transition: all 0.3s; cursor: pointer; }
.btn-gradient-success:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(40, 167, 69, 0.3); color: white; }
.btn-gradient-danger { background: linear-gradient(135deg, #dc3545, #e74c3c); border: none; color: white; border-radius: 50px; padding: 8px 22px; font-weight: 600; transition: all 0.3s; cursor: pointer; }
.btn-gradient-danger:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(220, 53, 69, 0.3); color: white; }
.border-end-custom { border-right: 1px solid #dee2e6; }
@media (max-width: 768px) { .border-end-custom { border-right: none; } }

/* ============================================
   BADGES SOFT
   ============================================ */
.badge-soft { padding: 4px 12px; border-radius: 50px; font-weight: 500; }
.badge-soft-success { background: #d4edda; color: #155724; }
.badge-soft-warning { background: #fff3cd; color: #856404; }
.badge-soft-danger { background: #f8d7da; color: #721c24; }
.badge-soft-info { background: #d1ecf1; color: #0c5460; }
.badge-soft-secondary { background: #e2e3e5; color: #383d41; }
.badge-soft-primary { background: #cfe2ff; color: #084298; }

/* ============================================
   TABLES
   ============================================ */
.table-container { background: white; border-radius: 16px; padding: 20px; box-shadow: var(--card-shadow); overflow-x: auto; }
.table thead th { background: var(--primary); color: white; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 14px; border: none; }
.table tbody td { padding: 8px 14px; vertical-align: middle; border-bottom: 1px solid #f0f2f5; font-size: 0.85rem; }
.table tbody tr:hover { background: #f8fafc; }

/* ============================================
   BOTONES ICONO
   ============================================ */
.btn-icon { width: 30px; height: 30px; border-radius: 8px; border: none; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; font-size: 0.8rem; cursor: pointer; }
.btn-icon:hover { transform: scale(1.1); }
.btn-icon-warning { background: #fff3cd; color: #856404; }
.btn-icon-warning:hover { background: #ffc107; color: #212529; }
.btn-icon-danger { background: #f8d7da; color: #721c24; }
.btn-icon-danger:hover { background: #dc3545; color: white; }
.btn-icon-info { background: #d1ecf1; color: #0c5460; }
.btn-icon-info:hover { background: #17a2b8; color: white; }
.btn-icon-primary { background: #d4edda; color: #155724; }
.btn-icon-primary:hover { background: #28a745; color: white; }
.btn-icon-secondary { background: #e2e3e5; color: #383d41; }
.btn-icon-secondary:hover { background: #6c757d; color: white; }
.btn-icon-success { background: #d4edda; color: #155724; }
.btn-icon-success:hover { background: #28a745; color: white; }

/* ============================================
   SLOTS / HORARIOS
   ============================================ */
.medico-card-horario { background: white; border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 0.75rem; border-left: 4px solid #e0e0e0; cursor: pointer; transition: all 0.3s; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.medico-card-horario:hover, .medico-card-horario.selected { border-left-color: var(--primary); background: #e8f4f8; transform: translateX(6px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.slot-item { background: #f8f9fa; border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s; border-left: 4px solid #ddd; }
.slot-item.disponible { background: #d4edda; border-left: 4px solid #28a745; }
.slot-item.ocupado { background: #f8d7da; border-left: 4px solid #dc3545; }
.slot-item.bloqueado { background: #fff3cd; border-left: 4px solid #ffc107; }
.slot-item:hover { transform: translateX(4px); }

/* ============================================
   FULLCALENDAR
   ============================================ */
.fc .fc-button-primary { background-color: var(--primary); border-color: var(--primary); }
.fc .fc-button-primary:hover { background-color: var(--primary-light); border-color: var(--primary-light); }
.fc-daygrid-day.fc-day-today { background-color: #e8f4f8 !important; }
.fc-daygrid-day { cursor: pointer; transition: background 0.2s; }
.fc-daygrid-day:hover { background-color: #f0f8ff !important; }
.fc-event { cursor: pointer; border-radius: 8px !important; border: none !important; padding: 4px 6px !important; font-size: 0.75rem !important; font-weight: 600 !important; }
.fc-event-slot { background-color: #28a745 !important; }
.fc-event-cita { background-color: #dc3545 !important; }
.fc-event .badge { font-size: 0.7rem !important; padding: 3px 6px !important; }
.fc-daygrid-event { white-space: normal !important; }
.fc-daygrid-event-dot { display: none !important; }

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-container { position: relative; height: 220px; }

/* ============================================
   PAGINACIÓN MUI
   ============================================ */
.mui-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding: 0.75rem 1rem; font-size: 0.875rem; color: rgba(0, 0, 0, 0.87); flex-wrap: wrap; }
.mui-pagination-info { display: flex; align-items: center; gap: 0.5rem; color: rgba(0, 0, 0, 0.6); }
.mui-rows-select { border: none; background: transparent; color: rgba(0, 0, 0, 0.87); font-size: 0.875rem; padding: 0.25rem 0.5rem; border-radius: 4px; cursor: pointer; outline: none; transition: background-color 0.2s; }
.mui-rows-select:hover { background-color: rgba(0, 0, 0, 0.04); }
.mui-pagination-range { color: rgba(0, 0, 0, 0.6); white-space: nowrap; }
.mui-pagination-nav .pagination { gap: 0.25rem; }
.mui-page-link { border: none !important; background: transparent !important; color: rgba(0, 0, 0, 0.87) !important; border-radius: 50% !important; width: 32px; height: 32px; display: flex !important; align-items: center; justify-content: center; padding: 0 !important; font-size: 0.875rem; transition: background-color 0.2s, color 0.2s; cursor: pointer; }
.mui-page-link:hover:not(:disabled):not(.mui-active) { background-color: rgba(25, 118, 210, 0.08) !important; }
.mui-page-link.mui-active { background-color: #1976d2 !important; color: #fff !important; }
.mui-page-link:disabled { color: rgba(0, 0, 0, 0.26) !important; cursor: default; }
.mui-pagination .page-item.disabled .mui-page-link { opacity: 0.5; }

/* ============================================
   CONTADORES DEL SIDEBAR
   ============================================ */

/* Badge de total de grupos en el header del sidebar */
.sidebar-header .logo .logo-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    margin-left: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 11px;
    vertical-align: middle;
}

/* Badge de total de items debajo del perfil */
.sidebar-user .user-info .user-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.7rem;
    color: #94a3b8;
    opacity: 0.85;
}

.sidebar-user .user-info .user-stats i {
    font-size: 0.65rem;
}

/* Contador por grupo */
.sidebar-nav .nav-label .nav-count {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 4px;
    opacity: 0.85;
}

/* ============================================
   TABLA - HEADER CON BUSCADOR Y FILTROS
   ============================================ */
.tabla-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tabla-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.tabla-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    white-space: nowrap;
}

.tabla-header-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== Buscador ===== */
.tabla-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tabla-search-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 0.8rem;
    pointer-events: none;
}

.tabla-search-input {
    width: 100%;
    padding: 7px 32px 7px 34px;
    border-radius: 50px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 0.82rem;
    color: #1e293b;
    transition: all 0.2s var(--ease);
    outline: none;
}

.tabla-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 161, 171, 0.12);
}

.tabla-search-input::placeholder {
    color: #94a3b8;
}

.tabla-search-clear {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.72rem;
    padding: 4px 6px;
    border-radius: 50%;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tabla-search-clear:hover {
    background: #f1f5f9;
    color: #475569;
}

/* ===== Filtros tipo chip ===== */
.tabla-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 50px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
    line-height: 1.2;
}

.filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.filter-btn i { font-size: 0.72rem; }

/* Variantes de color */
.filter-primary   { color: #1e40af; border-color: #bfdbfe; }
.filter-primary:hover,
.filter-primary.filter-primary-active { background: #2563eb; border-color: #2563eb; color: #fff; }

.filter-success   { color: #15803d; border-color: #bbf7d0; }
.filter-success:hover,
.filter-success.filter-success-active { background: #16a34a; border-color: #16a34a; color: #fff; }

.filter-warning   { color: #b45309; border-color: #fde68a; }
.filter-warning:hover,
.filter-warning.filter-warning-active { background: #f59e0b; border-color: #f59e0b; color: #fff; }

.filter-danger    { color: #b91c1c; border-color: #fecaca; }
.filter-danger:hover,
.filter-danger.filter-danger-active { background: #dc2626; border-color: #dc2626; color: #fff; }

.filter-info      { color: #0e7490; border-color: #a5f3fc; }
.filter-info:hover,
.filter-info.filter-info-active { background: #0891b2; border-color: #0891b2; color: #fff; }

.filter-secondary { color: #475569; border-color: #e2e8f0; }
.filter-secondary:hover,
.filter-secondary.filter-secondary-active { background: #475569; border-color: #475569; color: #fff; }



/* static/css/components/search.css */
/* ============================================
   COMPONENTE SEARCH - Coherente con dashboard
   ============================================ */

.search-component {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-input {
    width: 100%;
    padding: 10px 38px 10px 38px;
    background: #fff;
    color: #1e293b;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: inherit;
    transition: all 0.2s var(--ease);
    outline: none;
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 161, 171, 0.12);
    background: #fff;
}

/* Icono de lupa opcional (izquierda) */
.search-input-wrapper::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    opacity: 0.5;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-clear:hover {
    background: #f1f5f9;
    color: #475569;
}

/* Select de filtro estado */
.search-filtro-estado {
    padding: 10px 14px;
    background: #fff;
    color: #1e293b;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    outline: none;
    min-width: 130px;
}

.search-filtro-estado:hover {
    border-color: var(--accent);
}

.search-filtro-estado:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 161, 171, 0.12);
}
/* static/css/components/popper.css */
/* ============================================
   COMPONENTE POPPER - Coherente con dashboard
   ============================================ */

.popper-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.popper-backdrop-visible {
    opacity: 1;
}

.popper {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    color: #1e293b;
    opacity: 0;
    transform: scale(0.96);
    transition: all 0.2s var(--ease);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: inherit;
}

.popper-visible {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   POSICIONES
   ============================================ */
.popper-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
}
.popper-center.popper-visible {
    transform: translate(-50%, -50%) scale(1);
}

.popper-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%) scale(0.96);
}
.popper-top.popper-visible {
    transform: translateX(-50%) scale(1);
}

.popper-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) scale(0.96);
}
.popper-bottom.popper-visible {
    transform: translateX(-50%) scale(1);
}

.popper-left {
    top: 50%;
    left: 20px;
    transform: translateY(-50%) scale(0.96);
}
.popper-left.popper-visible {
    transform: translateY(-50%) scale(1);
}

.popper-right {
    top: 50%;
    right: 20px;
    transform: translateY(-50%) scale(0.96);
}
.popper-right.popper-visible {
    transform: translateY(-50%) scale(1);
}

/* ============================================
   HEADER
   ============================================ */
.popper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}

.popper-title {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popper-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.popper-close:hover {
    color: #dc3545;
    background: #fee2e2;
}

/* ============================================
   BODY
   ============================================ */
.popper-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.55;
    color: #334155;
    font-size: 0.9rem;
}

.popper-body p {
    margin-bottom: 10px;
}

.popper-body strong {
    color: var(--primary);
}

/* ============================================
   FOOTER
   ============================================ */
.popper-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

/* ============================================
   BOTONES
   ============================================ */
.popper-btn {
    padding: 9px 20px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}

/* Primary (teal accent) */
.popper-btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    border-color: transparent;
}
.popper-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 161, 171, 0.35);
}

/* Secondary (borde gris) */
.popper-btn-secondary {
    background: #fff;
    color: #475569;
    border-color: var(--border);
}
.popper-btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #f0fdfe;
}

/* Danger (rojo) */
.popper-btn-danger {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: #fff;
    border-color: transparent;
}
.popper-btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(220, 53, 69, 0.35);
}

/* Warning (amarillo) */
.popper-btn-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
    border-color: transparent;
}
.popper-btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

/* Success (verde real, no radiactivo) */
.popper-btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    border-color: transparent;
}
.popper-btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(40, 167, 69, 0.35);
}

/* static/css/modules/roles.css */

/* ============================================
   FORMULARIO DE ROL
   ============================================ */
.rol-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.rol-form label {
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
}

.rol-form .form-control {
    padding: 9px 12px;
    background: #fff;
    color: #1e293b;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: inherit;
    transition: all 0.2s var(--ease);
    outline: none;
}

.rol-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 161, 171, 0.12);
}

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

.rol-form .form-hint {
    font-size: 0.72rem;
    color: #94a3b8;
    font-style: italic;
}

.rol-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 500;
}

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

/* ============================================
   CELDA DE ROL
   ============================================ */
.rol-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rol-icon-sm {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 161, 171, 0.2);
}

/* ============================================
   ALERTAS SOFT DENTRO DE POPPER
   ============================================ */
.alert-info-soft {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #d1ecf1;
    border-left: 3px solid var(--info);
    border-radius: 8px;
    color: #0c5460;
    font-size: 0.85rem;
    margin-top: 10px;
}

.alert-info-soft i {
    color: var(--info);
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-warning-soft {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff3cd;
    border-left: 3px solid var(--warning);
    border-radius: 8px;
    color: #856404;
    font-size: 0.85rem;
    margin-top: 10px;
}

.alert-warning-soft i {
    color: #f59e0b;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ============================================
   TEXT MUTED
   ============================================ */
.text-muted {
    color: #94a3b8;
    font-style: italic;
}

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

.text-warning {
    color: #b45309;
}


/* static/css/modules/usuarios.css */

/* ============================================
   CELDA DE USUARIO CON AVATAR
   ============================================ */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-circle-sm {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0, 161, 171, 0.25);
}

/* ============================================
   CREDENCIALES BOX
   ============================================ */
.credenciales-box {
    background: #f0fdfe;
    border: 1px solid rgba(0, 161, 171, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
}

.credenciales-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(0, 161, 171, 0.15);
}

.credenciales-row:last-child {
    border-bottom: none;
}

.credenciales-label {
    font-size: 0.8rem;
    color: #475569;
    font-weight: 600;
}

.credenciales-pass {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 161, 171, 0.25);
    flex: 1;
    max-width: 60%;
    justify-content: space-between;
}

.credenciales-pass code {
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Consolas', 'Courier New', monospace;
    word-break: break-all;
}

.btn-copy {
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.btn-copy:hover {
    background: var(--accent);
    color: #fff;
}

.credenciales-box code {
    color: var(--primary);
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 600;
}

/* ============================================
   PASSWORD BOX (para popper de reset)
   ============================================ */
.password-box {
    background: #f0fdfe;
    border: 2px dashed var(--accent);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin: 12px 0;
}

.password-box code {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    word-break: break-all;
    font-family: 'Consolas', 'Courier New', monospace;
}

/* ============================================
   ALERTAS SOFT
   ============================================ */
.alert-info-soft {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #d1ecf1;
    border-left: 3px solid var(--info);
    border-radius: 8px;
    color: #0c5460;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.alert-info-soft i {
    color: var(--info);
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-warning-soft {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff3cd;
    border-left: 3px solid var(--warning);
    border-radius: 8px;
    color: #856404;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.alert-warning-soft i {
    color: #f59e0b;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ============================================
   TEXT HELPERS
   ============================================ */
.text-muted {
    color: #94a3b8;
}

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

.text-warning {
    color: #b45309;
}

/* ============================================
   BOTONES EXTRA
   ============================================ */
.btn-icon-secondary {
    background: #e2e3e5;
    color: #383d41;
}
.btn-icon-secondary:hover {
    background: #6c757d;
    color: white;
}

.btn-icon-success {
    background: #d4edda;
    color: #155724;
}
.btn-icon-success:hover {
    background: var(--success);
    color: white;
}
/* static/css/modules/servicios.css */

/* ============================================
   CELDA DE SERVICIO
   ============================================ */
.servicio-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.servicio-icon-sm {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 161, 171, 0.25);
}

/* ============================================
   FORMULARIO DE SERVICIO
   ============================================ */
.servicio-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.servicio-form label {
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
}

.servicio-form .form-control {
    padding: 9px 12px;
    background: #fff;
    color: #1e293b;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: inherit;
    transition: all 0.2s var(--ease);
    outline: none;
}

.servicio-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 161, 171, 0.12);
}

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

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

@media (max-width: 600px) {
    .servicio-form .form-row {
        grid-template-columns: 1fr;
    }
}

.servicio-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 500;
}

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

/* ============================================
   FORMULARIO DE RELACIÓN (3 columnas)
   ============================================ */
.form-row-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

@media (max-width: 768px) {
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

.rel-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.rel-form label {
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
}

.rel-form .form-control {
    padding: 9px 12px;
    background: #fff;
    color: #1e293b;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: inherit;
    transition: all 0.2s var(--ease);
    outline: none;
}

.rel-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 161, 171, 0.12);
}

.rel-form .form-control[readonly] {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

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

/* ============================================
   TARJETAS DE RELACIÓN (dentro del Popper)
   ============================================ */
.rel-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: all 0.2s var(--ease);
}

.rel-card:hover {
    background: #f0fdfe;
    border-color: rgba(0, 161, 171, 0.3);
    box-shadow: 0 2px 10px rgba(0, 161, 171, 0.08);
}

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

.rel-actions {
    display: flex;
    gap: 6px;
}

.rel-meta {
    font-size: 0.82rem;
    color: #64748b;
}

.rel-meta strong {
    color: var(--primary);
}

.rel-meta em {
    color: #94a3b8;
    font-style: italic;
}

/* ============================================
   SECCIONES EN POPPER DE ESPECIALIDADES
   ============================================ */
.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.section-divider {
    margin: 20px 0 16px;
    border: none;
    border-top: 1px dashed var(--border);
}

/* ============================================
   ALERT INFO SOFT
   ============================================ */
.alert-info-soft {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #d1ecf1;
    border-left: 3px solid var(--info);
    border-radius: 8px;
    color: #0c5460;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.alert-info-soft i {
    color: var(--info);
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-warning-soft {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff3cd;
    border-left: 3px solid var(--warning);
    border-radius: 8px;
    color: #856404;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.alert-warning-soft i {
    color: #f59e0b;
    margin-top: 2px;
    flex-shrink: 0;
}
/* static/css/modules/especialidades.css */

/* ============================================
   CELDA DE ESPECIALIDAD
   ============================================ */
.esp-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.esp-icon-sm {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #fff;
}

/* ============================================
   FORMULARIO DE ESPECIALIDAD
   ============================================ */
.especialidad-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.especialidad-form label {
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
}

.especialidad-form .form-control {
    padding: 9px 12px;
    background: #fff;
    color: #1e293b;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: inherit;
    transition: all 0.2s var(--ease);
    outline: none;
}

.especialidad-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 161, 171, 0.12);
}

.especialidad-form input[type="color"] {
    height: 42px;
    padding: 4px;
    cursor: pointer;
}

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

.especialidad-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
/* =============================================
   GRUPOS COLAPSABLES CON ICONOS
   ============================================= */

.nav-group-details > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Para separar el título de la flechita */
    padding: 10px 14px;
    margin-top: 8px;
    margin-bottom: 2px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

/* Efecto hover sobre el título del grupo */
.nav-group-details > summary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

/* El contenedor del icono y el texto */
.group-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Estilo del icono del grupo */
.group-title .group-icon {
    font-size: 1rem;
    color: #64748b;
    transition: color 0.2s;
}

.nav-group-details[open] > summary .group-icon {
    color: #00a1ab; /* Se ilumina con tu color Teal al abrir */
}

/* Ocultar la flecha por defecto */
.nav-group-details > summary::-webkit-details-marker {
    display: none;
}

/* Flecha personalizada de la derecha */
.nav-group-details > summary::after {
    content: '▶';
    font-size: 0.65em;
    color: #64748b;
    transition: transform 0.3s ease, color 0.2s;
}

.nav-group-details[open] > summary::after {
    transform: rotate(90deg);
    color: #00a1ab;
}

/* Contenedor de los items dentro del grupo */
.nav-group-items {
    padding-left: 10px;
    margin-bottom: 8px;
    animation: fadeIn 0.2s ease-in-out;
}

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

/* Ajuste de los items internos */
.nav-group-items .nav-link {
    padding: 8px 12px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-group-items .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-group-items .nav-link.active {
    background: #00a1ab;
    color: white;
    font-weight: 600;
}

@media (max-width: 600px) {
    .especialidad-form .form-row {
        grid-template-columns: 1fr;
    }
}

.especialidad-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 500;
}

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

/* ============================================
   TARJETAS DE RELACIÓN (reutilizadas de servicios)
   ============================================ */
.rel-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: all 0.2s var(--ease);
}

.rel-card:hover {
    background: #f0fdfe;
    border-color: rgba(0, 161, 171, 0.3);
    box-shadow: 0 2px 10px rgba(0, 161, 171, 0.08);
}

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

.rel-meta {
    font-size: 0.82rem;
    color: #64748b;
}

.rel-meta strong {
    color: var(--primary);
}

.rel-meta em {
    color: #94a3b8;
    font-style: italic;
}

/* ============================================
   SECCIONES EN POPPER
   ============================================ */
.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

/* ============================================
   ALERTAS SOFT (reutilizables)
   ============================================ */
.alert-info-soft {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #d1ecf1;
    border-left: 3px solid var(--info);
    border-radius: 8px;
    color: #0c5460;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.alert-info-soft i {
    color: var(--info);
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-warning-soft {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff3cd;
    border-left: 3px solid var(--warning);
    border-radius: 8px;
    color: #856404;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.alert-warning-soft i {
    color: #f59e0b;
    margin-top: 2px;
    flex-shrink: 0;
}

/* static/css/modules/tipos-contrato.css */

/* ============================================
   CELDA DE TIPO CONTRATO
   ============================================ */
.tc-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tc-icon-sm {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 161, 171, 0.25);
}

/* ============================================
   FORMULARIO DE TIPO CONTRATO
   ============================================ */
.tipo-contrato-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.tipo-contrato-form label {
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
}

.tipo-contrato-form .form-control {
    padding: 9px 12px;
    background: #fff;
    color: #1e293b;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: inherit;
    transition: all 0.2s var(--ease);
    outline: none;
}

.tipo-contrato-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 161, 171, 0.12);
}

.tipo-contrato-form textarea.form-control {
    resize: vertical;
    min-height: 60px;
}

.tipo-contrato-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .tipo-contrato-form .form-row {
        grid-template-columns: 1fr;
    }
}

.tipo-contrato-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 500;
}

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

.tipo-contrato-form .text-muted {
    color: #94a3b8;
    font-size: 0.75rem;
    font-style: italic;
}

/* ============================================
   ALERTAS SOFT
   ============================================ */
.alert-warning-soft {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff3cd;
    border-left: 3px solid var(--warning);
    border-radius: 8px;
    color: #856404;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.alert-warning-soft i {
    color: #f59e0b;
    margin-top: 2px;
    flex-shrink: 0;
}

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

.text-warning {
    color: #b45309;
}

/* Popper usado como dropdown (sin backdrop, sin header) */
.popper-dropdown {
    z-index: 10000;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
    padding: 4px 0;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.popper-dropdown .popper-header {
    display: none !important;
}

.popper-dropdown .popper-body {
    padding: 0 !important;
}

.filtro-opcion-popper:hover {
    background: #f8f9fa !important;
}

.filtro-opcion-activa {
    background: #f0fdfd !important;
    font-weight: 600;
}
.dias-checkboxes {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.dia-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    user-select: none;
    transition: all 0.15s ease;
}

.dia-checkbox:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.dia-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.dia-checkbox input[type="checkbox"]:checked ~ span {
    font-weight: 600;
    color: #0d6efd;
}

.dia-checkbox:has(input:checked) {
    background: #e7f1ff;
    border-color: #0d6efd;
}
.btn-link-inline {
    background: none;
    border: none;
    color: #1e88e5;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    font-weight: 500;
}
.btn-link-inline:hover {
    color: #0d47a1;
}
.especialidades-list {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px;
    background: #fff;
}
.especialidad-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.especialidad-item:hover { background: #f8fafc; }
.especialidad-item .esp-nombre { flex: 1; }
.especialidad-item.base-item { background: #fefce8; }
.especialidad-item.base-item:hover { background: #fef9c3; }
/* ============================================
   UTILIDADES
   ============================================ */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* ============================================= */
/* POPPER DE NOTIFICACIONES                      */
/* ============================================= */
.notification-popper-wrapper {
    position: relative;
    display: inline-block;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideDown 0.15s ease-out;
}

.notification-dropdown.open {
    display: flex;
}

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

.notification-header {
    padding: 14px 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.notification-header h6 {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
}

.notification-header a {
    color: #0d6efd;
    text-decoration: none;
    font-size: 12px;
}

.notification-header a:hover {
    text-decoration: underline;
}

.notification-list {
    overflow-y: auto;
    max-height: 360px;
    flex: 1;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    gap: 12px;
    transition: background 0.15s;
    align-items: flex-start;
}

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

.notification-item.unread {
    background: #f0f7ff;
    border-left: 3px solid #0d6efd;
}

.notification-item.unread:hover {
    background: #e7f0ff;
}

.notification-item.read {
    opacity: 0.65;
}

.notification-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.notification-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 3px;
    color: #212529;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-date {
    font-size: 11px;
    color: #6c757d;
}

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

.notification-footer a {
    color: #0d6efd;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.notification-footer a:hover {
    text-decoration: underline;
}

/* Badge responsivo para móvil */
@media (max-width: 576px) {
    .notification-dropdown {
        width: calc(100vw - 20px);
        right: -10px;
    }
}
/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .app-sidebar {
        position: fixed;
        top: 0; left: 0;
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
        min-width: var(--sidebar-width) !important;
        height: 100vh;
        z-index: 1100;
    }
    .app-sidebar.active { transform: translateX(0); }

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

    .navbar-toggle { display: block; }
    .profile-name  { display: none; }
    .app-content   { padding: 16px; }
    .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .action-grid { grid-template-columns: 1fr 1fr; }
    .top-bar { flex-direction: column; align-items: stretch; }
    .top-bar .top-actions { justify-content: center; }
    .app-content { padding: 12px; }
    .navbar-title { font-size: .95rem; }
}