/* --- CSS VARIABLES & RESET (Alineado con DQ_WEB) --- */
:root {
    /* Colores Corporativos DQ */
    --primary: #1A7A4A;      /* Verde Principal */
    --primary-dark: #0C2A18; /* Verde Oscuro/Noche */
    --primary-light: #D0EED9;/* Verde Suave */
    --accent: #5CC98A;       /* Verde Acento */
    --secondary: #80858C;    /* Gris Secundario */

    /* Backgrounds */
    --bg-body: #F5F7F5;
    --bg-white: #ffffff;
    --bg-sidebar: #ffffff;

    /* Text */
    --text-main: #333333;
    --text-light: #666666;
    --text-sidebar: #0C2A18;

    /* Status Colors */
    --status-green: #28a745;
    --status-red: #dc3545;
    --status-yellow: #ffc107;

    /* Typography */
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* Spacing & Borders */
    --radius: 8px;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--primary); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- UTILITIES --- */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-heading);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-size: 0.9rem;
}
.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 5px rgba(26, 122, 74, 0.3);
}
.btn-primary:hover { background-color: var(--primary-dark); }
.btn-secondary { background-color: var(--secondary); color: white; }
.btn-secondary:hover { filter: brightness(1.1); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: rgba(26, 122, 74, 0.05); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-danger { background-color: var(--status-red); color: white; }
.btn-danger:hover { filter: brightness(0.9); }

.input-group { margin-bottom: 15px; }
.input-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.9rem; color: var(--primary-dark); }
.input-control, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-family: var(--font-body);
}
.input-control:focus, textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: white;
    padding: 15px 20px;
    border-radius: var(--radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-left: 5px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
    min-width: 300px;
    font-family: var(--font-heading);
}
.toast.success { border-color: var(--status-green); }
.toast.error { border-color: var(--status-red); }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* --- LAYOUT --- */
#app { display: flex; height: 100%; width: 100%; }

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    border-right: 1px solid #eee;
    transition: width 0.3s;
}
.logo-area {
    padding: 0 14px 16px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.logo-img {
    max-height: 60px;
    width: auto;
    margin-bottom: 5px;
}
.logo-subtitle {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--secondary);
    letter-spacing: 0.5px;
}

.nav-links { flex: 1; padding: 0 10px; }
.nav-item {
    padding: 12px 15px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--secondary);
    margin-bottom: 5px;
    transition: all 0.2s;
    font-family: var(--font-heading);
    font-weight: 500;
}
.nav-item:hover, .nav-item.active {
    background-color: rgba(26, 122, 74, 0.07);
    color: var(--primary);
}
.nav-item.active { border-left: 3px solid var(--primary); }
.nav-item i { font-size: 1.2rem; }

.user-area {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #fafafa;
}
.user-avatar {
    width: 40px; height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
    font-family: var(--font-heading);
    overflow: hidden;
    flex-shrink: 0;
}
.user-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* ── Foto de perfil en Mi Perfil ─────────────────────────── */
.profile-photo-section {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eee;
}
.profile-photo-wrap {
    position: relative;
    width: 88px; height: 88px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}
.profile-photo-circle {
    width: 88px; height: 88px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
    font-size: 1.9rem;
    font-family: var(--font-heading);
    overflow: hidden;
    border: 3px solid #c8e6c9;
}
.profile-photo-circle img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.profile-photo-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.42);
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    color: #fff;
    font-size: 1.5rem;
}
.profile-photo-wrap:hover .profile-photo-overlay { opacity: 1; }
.profile-photo-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.profile-photo-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    font-family: var(--font-body);
}
.profile-photo-subhint {
    font-size: 0.78rem;
    color: #999;
    font-family: var(--font-body);
}
#profile-photo-input { display: none; }

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background-color: var(--bg-body);
    position: relative;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.page-title h2 { font-size: 1.8rem; color: var(--primary-dark); }
.page-title p { color: var(--secondary); margin-top: 5px; font-family: var(--font-body); }

/* --- VIEWS --- */
.view { display: none; animation: fadeIn 0.3s; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Login View */
.login-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}
.login-logo-img { width: 150px; margin-bottom: 10px; }

/* Dashboard Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.kpi-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary);
    transition: transform 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); }
.kpi-label { font-size: 0.85rem; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.5px; font-family: var(--font-body); }
.kpi-value { font-size: 1.8rem; font-weight: 700; color: var(--primary-dark); margin-top: 5px; font-family: var(--font-heading); }
.kpi-sub { font-size: 0.8rem; margin-top: 5px; color: var(--text-light); }

/* Pipeline Kanban */
.pipeline-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    height: calc(100vh - 200px);
    padding-bottom: 20px;
}
.pipeline-column {
    min-width: 280px;
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: var(--radius);
    padding: 10px;
    display: flex;
    flex-direction: column;
}
.column-header {
    padding: 10px;
    font-weight: 600;
    color: var(--primary-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 2px solid #f4f4f4;
}
.column-count {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}
.pipeline-list {
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
    background: #fafafa;
    border-radius: 4px;
    padding: 5px;
}
.opportunity-card {
    background: white;
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    cursor: pointer;
    border-left: 4px solid #ddd;
    transition: transform 0.15s, box-shadow 0.15s, border-left-color 0.15s;
    border: 1px solid #eee;
    border-left-width: 4px;
}
.opportunity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    border-left-color: var(--primary);
}
.opportunity-card.status-8 { border-left-color: var(--status-green); }
.opportunity-card.status-8:hover { border-left-color: var(--status-green); }
.opportunity-card.status-9 { border-left-color: var(--status-red); }
.opportunity-card.status-9:hover { border-left-color: var(--status-red); }
.opportunity-card.status-10 { border-left-color: #6c757d; }
.opportunity-card.status-10:hover { border-left-color: #6c757d; }

.card-id { font-size: 0.7rem; color: var(--secondary); margin-bottom: 2px; }
.card-title { font-weight: 600; margin-bottom: 5px; color: var(--primary-dark); font-family: var(--font-heading); }
.card-company { font-size: 0.85rem; color: var(--secondary); margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; font-weight: 600; }
.card-edit-icon { color: #ccc; font-size: 1rem; transition: color 0.15s; }
.opportunity-card:hover .card-edit-icon { color: var(--primary); }

/* Report Table Styles */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    overflow: hidden;
}
.report-table th { background: var(--primary-dark); color: white; padding: 12px; text-align: left; font-family: var(--font-heading); }
.report-table td { padding: 12px; border-bottom: 1px solid #eee; }
.report-table tr:last-child td { border-bottom: none; }

/* Filter Bar */
.report-filter-bar {
    background: white;
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 5px solid var(--secondary);
}

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(12, 42, 24, 0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
    background: white;
    width: 90%; max-width: 700px;
    max-height: 90vh;
    border-radius: 12px;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.modal-header {
    padding: 20px;
    background: var(--primary);
    color: white;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { padding: 20px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 10px; background: #fafafa; }

/* History Items */
.history-item {
    border-left: 3px solid #eee;
    padding-left: 15px;
    margin-bottom: 15px;
}
.history-date { font-size: 0.8rem; color: var(--secondary); font-weight: bold; }
.history-note { margin-top: 5px; color: var(--text-main); }

/* Table */
.table-responsive { overflow-x: auto; background: white; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; font-family: var(--font-body); }
th { background: var(--primary-dark); color: white; font-weight: 600; white-space: nowrap; font-family: var(--font-heading); }
tr:hover { background: #f0f9f4; }

/* Companies search bar */
.companies-search-bar {
    display: flex;
    align-items: center;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: var(--radius);
    padding: 0 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: border-color 0.2s;
}
.companies-search-bar:focus-within {
    border-color: var(--primary);
}
.companies-search-bar > i {
    color: var(--secondary);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.companies-search-bar input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 10px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-main);
    background: transparent;
}
.companies-search-bar input::placeholder { color: #bbb; }
.companies-search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    padding: 4px;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
}
.companies-search-clear:hover { color: var(--primary); background: #e8f7ef; }

/* Pipeline filter bar — search + user dropdown side by side */
.pipeline-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.pipeline-filter-bar .pipeline-search-bar {
    max-width: 380px;
    flex: 1 1 200px;
    margin-bottom: 0;
}
.pipeline-user-select {
    min-width: 150px;
    max-width: 210px;
    height: 44px;
    padding: 0 12px;
    flex-shrink: 0;
}

/* Companies sort bar */
.companies-sort-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: var(--radius);
    padding: 8px 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}
.sort-bar-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 4px;
}
.sort-group {
    display: flex;
    align-items: center;
    gap: 4px;
}
.sort-group-label {
    font-size: 0.78rem;
    color: #999;
    margin-right: 2px;
}
.btn-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.82rem;
    font-family: var(--font-body);
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.btn-sort:hover { background: #e8f7ef; border-color: var(--primary); color: var(--primary); }
.btn-sort.active { background: var(--primary); border-color: var(--primary-dark); color: white; }
.btn-sort-clear {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-family: var(--font-body);
    background: none;
    border: 1px solid #ccc;
    border-radius: 20px;
    color: #888;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.btn-sort-clear:hover { color: var(--primary); border-color: var(--primary); }
.btn-sort-clear.visible { display: inline-flex; }

/* Pagination */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    font-family: var(--font-body);
}
.pagination-info { font-size: 0.85rem; color: var(--secondary); }
.pagination-controls { display: flex; align-items: center; gap: 4px; }
.pagination-arrow, .pagination-num {
    border: 1px solid #ddd;
    background: white;
    color: var(--text-main);
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font-body);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pagination-arrow:hover:not(:disabled), .pagination-num:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-arrow:disabled { opacity: 0.35; cursor: default; }
.pagination-num.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -100%; height: 100%; z-index: 1000; width: 80%; box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    .sidebar.active { left: 0; }
    .main-content { width: 100%; padding: 15px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .mobile-toggle { display: block; font-size: 1.5rem; cursor: pointer; color: var(--primary); }
}
@media (min-width: 769px) { .mobile-toggle { display: none; } }

/* --- INLINE STYLE CLASSES --- */
.hidden { display: none; }
.login-subtitle { margin-bottom: 20px; color: var(--secondary); font-family: var(--font-body); }
.btn-full { width: 100%; justify-content: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.info-box { margin-top: 20px; font-size: 0.8rem; color: #999; background: #f9f9f9; padding: 10px; border-radius: 4px; }
.app-hidden { display: none; }
.flex-1 { flex: 1; }
.user-name { font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
.user-role { font-size: 0.75rem; opacity: 0.7; }
.btn-logout { border-color: #ddd; }
.kpi-secondary { border-top-color: var(--secondary); }
.label-bold { font-weight: bold; font-family: var(--font-heading); }
.select-max { max-width: 250px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.h4-primary { color: var(--primary); margin-bottom: 15px; }
.table-small { font-size: 0.9rem; }
.grid-2-no-margin { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.text-small { font-size: 0.85rem; color: #666; margin-bottom: 10px; }
.grid-1 { display: grid; gap: 20px; }
.h4-primary-no-margin { color: var(--primary); }
.user-form-bg { background: #fafafa; padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #eee; }
.grid-2-small { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3-small { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.modal-wide { max-width: 820px !important; }
.modal-header { align-items: flex-start !important; }
.stage-badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 10px; border-radius: 20px; margin-top: 4px; letter-spacing: 0.02em; }
.stage-badge-open   { background: #f0f4ff; color: #3a6bdc; }
.stage-badge-won    { background: #e6f9ee; color: #1a7a40; }
.stage-badge-lost   { background: #fdecea; color: #b71c1c; }
.stage-badge-closed { background: #f2f2f2; color: #555; }
.company-info-strip {
    display: none; flex-wrap: wrap; gap: 12px;
    background: #f8f9fa; border: 1px solid #eee; border-radius: var(--radius);
    padding: 10px 14px; margin-top: -6px; margin-bottom: 12px; font-size: 0.82rem; color: var(--secondary);
}
.company-info-strip.is-visible { display: flex; }
.company-info-strip span { display: flex; align-items: center; gap: 5px; }
.company-info-strip span.is-hidden { display: none; }
.input-no-margin { margin-bottom: 0; }
.input-small { padding: 8px; }
.grid-2-margin { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; align-items: end; }
.btn-margin-top { margin-top: 10px; }
.h4-primary-margin { color: var(--primary); }
.text-light { margin-bottom: 10px; font-family: var(--font-body); color: var(--text-light); }
.flex-gap { display: flex; gap: 10px; align-items: flex-end; }
.label-small { font-size: 0.8rem; font-weight: bold; }
.input-large { font-size: 1.2rem; font-weight: bold; }
.kpi-gray { border-top: 4px solid #666; }
.h4-gray { color: #333; }
.text-margin { margin-bottom: 15px; color: #666; }
.grid-2-import { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.text-light-margin { margin-bottom: 10px; font-family: var(--font-body); color: var(--text-light); }
.flex-center { display: flex; gap: 10px; align-items: center; }
.btn-flex { flex: 1; justify-content: center; }
.file-name { font-size: 0.8rem; color: #666; margin-top: 5px; }
.modal-title { color: white; font-family: var(--font-heading); }
.btn-modal-close { background: transparent; border: none; color: white; cursor: pointer; display: inline-flex; align-items: center; padding: 6px; border-radius: var(--radius); }
.btn-modal-close:hover { background: rgba(255,255,255,0.15); }
.input-disabled { background: #eee; }
.btn-left { margin-right: auto; }
.history-list-container { margin-bottom: 20px; max-height: 300px; overflow-y: auto; }
.section-divider { border-top: 1px solid #eee; padding-top: 15px; }
.file-input-hidden { display: none; }
.btn-excel { background-color: #1D6F42; color: #fff; border-color: #1D6F42; }
.btn-excel:hover { background-color: #155a34; border-color: #155a34; }

.input-group-password { position: relative; }
.input-password { padding-right: 2.5rem; }
.btn-password-toggle { position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #888; padding: 0; font-size: 1.1rem; z-index: 2; line-height: 1; }
.btn-password-toggle:hover { color: var(--primary); }
.btn-password-toggle [data-eye-closed] { display: none; }
.btn-password-toggle[data-show] [data-eye-open] { display: none; }
.btn-password-toggle[data-show] [data-eye-closed] { display: block; }

/* ── NOTIFICACIONES ─────────────────────────────────────── */
.sidebar { position: relative; }

.notif-bell-wrapper { padding: 4px 10px; }

.notif-bell-btn {
    position: relative;
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border-radius: var(--radius);
    color: var(--secondary);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.notif-bell-btn:hover { background: rgba(26,122,74,0.07); color: var(--primary); }
.notif-bell-btn i { font-size: 1.2rem; }

.notif-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 1px 5px;
    min-width: 18px;
    text-align: center;
    font-family: var(--font-heading);
    line-height: 1.5;
    pointer-events: none;
}

.notif-panel {
    position: absolute;
    left: var(--sidebar-width);
    bottom: 60px;
    width: 340px;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 1px solid #eee;
    z-index: 600;
    animation: fadeIn 0.18s ease;
    overflow: hidden;
}
.notif-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
}
.notif-panel-title {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.9rem;
}
.notif-mark-all-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--secondary);
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-family: var(--font-heading);
    transition: color 0.2s;
}
.notif-mark-all-btn:hover { color: var(--primary); }

.notif-list { max-height: 380px; overflow-y: auto; }

.notif-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--secondary);
    font-family: var(--font-body);
    font-size: 0.88rem;
}
.notif-empty i { font-size: 2rem; display: block; margin-bottom: 8px; opacity: 0.35; }

.notif-item {
    padding: 11px 14px;
    border-bottom: 1px solid #f4f4f4;
    display: flex;
    gap: 11px;
    align-items: flex-start;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #fafafa; }
.notif-item.unread { background: rgba(26,122,74,0.04); }
.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.notif-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.notif-icon.Reunion      { background: rgba(0,119,182,0.1);  color: #0077b6; }
.notif-icon.Recordatorio { background: rgba(255,193,7,0.15); color: #c9960a; }
.notif-icon.SinActividad { background: rgba(253,126,20,0.1); color: #e07b00; }
.notif-icon.Otro         { background: rgba(128,133,140,0.1); color: var(--secondary); }

.notif-content { flex: 1; min-width: 0; }
.notif-title {
    font-weight: 600;
    font-size: 0.83rem;
    color: var(--text-main);
    font-family: var(--font-heading);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-msg {
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.4;
    font-family: var(--font-body);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-time {
    font-size: 0.71rem;
    color: var(--secondary);
    margin-top: 3px;
    font-family: var(--font-body);
}
.notif-delete-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ccc;
    padding: 2px 4px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    flex-shrink: 0;
    font-size: 0.85rem;
    line-height: 1;
}
.notif-item:hover .notif-delete-btn { opacity: 1; }
.notif-delete-btn:hover { color: var(--status-red); }
.notif-item.notif-item-clickable { cursor: pointer; }
.notif-item.notif-item-clickable:hover { background: #edf8f3; }
.kpi-live-mode { border-left: 4px solid #2e7d32; }
.h4-live-mode { color: #2e7d32; margin-top: 0; }
.text-live-mode { color: #2e7d32; }

/* --- TOGGLE SWITCH --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: background-color 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* --- REMINDER SECTION --- */
.reminder-section {
    border: 1px solid #c8e6d5;
    border-radius: var(--radius);
    padding: 12px 14px;
    background: #f2faf5;
    margin-top: 4px;
}
.reminder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.reminder-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--primary-dark);
    font-family: var(--font-heading);
}
.reminder-fields {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.reminder-fields.hidden { display: none; }
.reminder-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.reminder-delete-btn { display: none; }
.reminder-delete-btn.visible { display: inline-flex; }
.reminder-date-wrapper { display: flex; align-items: center; gap: 6px; }
.reminder-date-wrapper .input-control { flex: 1; min-width: 0; }
.btn-calendar-pick {
    flex-shrink: 0;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 0 11px;
    height: 41px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    transition: background 0.15s;
}
.btn-calendar-pick:hover { background: var(--primary-dark); }

/* --- CUSTOM CALENDAR POPUP --- */
.custom-cal-popup {
    position: fixed;
    z-index: 99999;
    background: #fff;
    border: 1px solid #b8ddc8;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    width: 240px;
    padding: 12px;
    display: none;
    -webkit-user-select: none;
    user-select: none;
}
.custom-cal-popup.open { display: block; }
.custom-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.custom-cal-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--primary-dark);
    text-transform: capitalize;
}
.custom-cal-nav {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 1rem;
    padding: 3px 7px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s;
}
.custom-cal-nav:hover { background: #d4eddf; }
.custom-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    padding-bottom: 6px;
    border-bottom: 1px solid #c8e6d5;
    margin-bottom: 6px;
}
.custom-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.custom-cal-day {
    text-align: center;
    font-size: 0.8rem;
    border-radius: 50%;
    cursor: pointer;
    color: #333;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}
.custom-cal-day:hover:not(.disabled):not(.selected) { background: #d4eddf; }
.custom-cal-day.today { font-weight: 700; color: var(--primary); }
.custom-cal-day.selected { background: var(--primary); color: #fff; font-weight: 700; }
.custom-cal-day.selected.today { background: var(--primary-dark); }
.custom-cal-day.disabled { color: #ccc; cursor: default; }
.custom-cal-day.other-month { color: #ccc; }
.custom-cal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #c8e6d5;
}
.custom-cal-footer-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}
.custom-cal-footer-btn:hover { background: #d4eddf; }

/* --- USER PREFERENCES --- */
.prefs-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}
.prefs-notif-label { font-size: 0.85rem; }
.prefs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}
@media (max-width: 700px) {
    .prefs-grid { grid-template-columns: 1fr; }
}

.outlook-status-area { margin-top: 12px; }

/* --- CONSECUTIVO INPUT ROW --- */
.consecutivo-row { display: flex; gap: 8px; align-items: center; }
.consecutivo-num { flex: 1; }
.consecutivo-sep { color: var(--secondary); font-size: 1.2rem; line-height: 1; }
.consecutivo-suffix { width: 90px; flex-shrink: 0; }
.consecutivo-hint { color: var(--secondary); }

/* --- DUAL LOGO (Sidebar) --- */
.logo-dual {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.logo-dual > .logo-img {
    max-height: 44px;
    max-width: 120px;
    width: auto;
    object-fit: contain;
    flex-shrink: 1;
}
.logo-sep {
    width: 1px;
    height: 36px;
    background: #ddd;
    flex-shrink: 0;
}

/* --- DUAL LOGO (Login) --- */
.login-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 10px;
}
.login-logos .login-logo-img {
    width: 110px;
    margin-bottom: 0;
}
.login-logo-sep {
    width: 1px;
    height: 50px;
    background: #ddd;
    flex-shrink: 0;
}

/* Ícono DQ — el fondo ya está integrado en la imagen */
.logo-dq-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-dq-wrap .login-logo-img {
    width: 64px;
    height: 64px;
    margin-bottom: 0;
    border-radius: 14px;
}
.logo-dq-wrap--sm .logo-img {
    max-height: 44px;
    width: auto;
    border-radius: 10px;
}

/* --- SEARCHABLE SELECT --- */
.ss-wrap {
    position: relative;
    width: 100%;
    -webkit-user-select: none;
    user-select: none;
}
.ss-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    background: var(--bg-white);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-main);
    transition: border-color 0.2s, outline 0.2s;
    min-height: 42px;
}
.ss-display:hover { border-color: var(--primary); }
.ss-wrap.is-open .ss-display {
    outline: 2px solid var(--primary);
    border-color: transparent;
}
.ss-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-label.ss-placeholder { color: #999; }
.ss-caret {
    flex-shrink: 0;
    font-size: 1rem;
    color: var(--secondary);
    margin-left: 6px;
    transition: transform 0.2s;
}
.ss-wrap.is-open .ss-caret { transform: rotate(180deg); }

.ss-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--bg-white);
    border: 1px solid #ddd;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    overflow: hidden;
}
.ss-wrap.is-open .ss-dropdown { display: block; }

.ss-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}
.ss-search-row i { color: var(--secondary); font-size: 1rem; flex-shrink: 0; }
.ss-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-main);
}
.ss-input::placeholder { color: #aaa; }

.ss-list {
    max-height: 200px;
    overflow-y: auto;
}
.ss-option {
    padding: 9px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: background 0.15s;
    border-bottom: 1px solid #f5f5f5;
}
.ss-option:last-child { border-bottom: none; }
.ss-option:hover { background: var(--primary-light); color: var(--primary-dark); }
.ss-option.is-selected {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}
.ss-empty {
    padding: 12px;
    text-align: center;
    color: var(--secondary);
    font-size: 0.85rem;
}


/* --- Profile photo meta helpers --- */
.profile-photo-hint { font-size: 0.85rem; }
.profile-photo-subhint { font-size: 0.78rem; opacity: 0.7; }
.profile-photo-remove-btn { display: none; margin-top: 4px; }
.profile-photo-input { display: none; }
