:root {
    --fe-primary: #6f42c1;
    --fe-primary-dark: #56309e;
    --fe-primary-soft: #f0eaff;
    --fe-navy: #1b2a41;
    --fe-text: #202940;
    --fe-muted: #6f7890;
    --fe-bg: #f4f6fb;
    --fe-card: #ffffff;
    --fe-border: #e2e6ef;
    --fe-danger: #dc3545;
    --fe-danger-soft: #fff0f1;
    --fe-success: #198754;
    --fe-success-soft: #eaf8f1;
    --fe-warning: #ffc107;
    --fe-shadow: 0 18px 50px rgba(32, 41, 64, .10);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { color: var(--fe-text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

/* Acceso */
.auth-page {
    background:
        radial-gradient(circle at 15% 15%, rgba(111, 66, 193, .15), transparent 31rem),
        radial-gradient(circle at 90% 80%, rgba(27, 42, 65, .10), transparent 30rem),
        var(--fe-bg);
    display: flex;
    align-items: center;
}
.auth-shell { max-width: 880px; }
.auth-card {
    max-width: 520px;
    margin: 0 auto;
    background: rgba(255,255,255,.97);
    border: 1px solid rgba(226,230,239,.95);
    border-radius: 24px;
    box-shadow: var(--fe-shadow);
    padding: 34px;
    position: relative;
}
.auth-card-wide { max-width: 820px; }
.landing-card { max-width: 760px; }
.brand-block h1 { font-weight: 850; letter-spacing: -.04em; color: var(--fe-navy); text-transform: none; }
.brand-block p { color: var(--fe-muted); margin-bottom: 0; }
.brand-logo { width: 92px; height: 92px; object-fit: contain; margin-bottom: 10px; }
.compact-brand .brand-logo { width: 72px; height: 72px; }
.compact-brand h1 { font-size: 1.75rem; }
.back-link { color: var(--fe-muted); text-decoration: none; font-weight: 700; font-size: .9rem; }
.back-link:hover { color: var(--fe-primary); }
.landing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.landing-option {
    text-decoration: none;
    color: var(--fe-text);
    border: 1px solid var(--fe-border);
    border-radius: 18px;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: .2s ease;
    background: #fff;
}
.landing-option:hover { transform: translateY(-3px); border-color: #cbb8ff; box-shadow: 0 12px 28px rgba(111,66,193,.12); color: var(--fe-text); }
.landing-option strong { font-size: 1.08rem; margin-top: 12px; }
.landing-option small { color: var(--fe-muted); margin-top: 4px; }
.landing-icon { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: var(--fe-primary-soft); color: var(--fe-primary); font-size: 1.4rem; }
.landing-icon.warning { background: #fff7db; color: #a87900; }
.form-label { font-weight: 750; color: #39435a; font-size: .88rem; }
.form-control, .form-select { border-color: var(--fe-border); border-radius: 11px; min-height: 46px; }
.form-control:focus, .form-select:focus { border-color: #a887f1; box-shadow: 0 0 0 .23rem rgba(111,66,193,.12); }
.btn { border-radius: 11px; font-weight: 750; }
.btn-primary { background: var(--fe-primary); border-color: var(--fe-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--fe-primary-dark); border-color: var(--fe-primary-dark); }
.auth-note { display: flex; align-items: flex-start; gap: 11px; background: #f7f8fc; border: 1px solid var(--fe-border); border-radius: 13px; padding: 14px; color: var(--fe-muted); font-size: .85rem; }
.auth-note i { color: var(--fe-primary); margin-top: 2px; }
.fast-card { max-width: 430px; }
.fast-display { width: 100%; border: 0; background: #f2f0fa; color: var(--fe-navy); border-radius: 14px; text-align: center; letter-spacing: 18px; font-size: 2rem; font-weight: 850; padding: 16px 5px 16px 22px; outline: none; }
.secure-pin-input {
    -webkit-text-security: disc;
    text-security: disc;
    caret-color: var(--fe-primary);
}
.secure-pin-input::selection { background: rgba(111,66,193,.18); }
.numeric-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 18px; }
.keypad-key { border: 1px solid var(--fe-border); background: #fff; border-radius: 14px; min-height: 61px; color: var(--fe-navy); font-size: 1.35rem; font-weight: 850; box-shadow: 0 5px 12px rgba(32,41,64,.05); }
.keypad-key:active { transform: scale(.97); background: var(--fe-primary-soft); }
.keypad-key.key-action { color: var(--fe-primary); background: #faf9ff; }

/* Aplicación */
.app-body { background: var(--fe-bg); min-height: 100vh; }
.app-container { max-width: 1540px; }
.app-navbar { background: rgba(255,255,255,.94); border-bottom: 1px solid var(--fe-border); backdrop-filter: blur(14px); min-height: 68px; }
.app-brand { display: flex; align-items: center; gap: 10px; color: var(--fe-navy); font-size: 1.2rem; letter-spacing: -.02em; }
.app-brand:hover { color: var(--fe-navy); }
.app-brand-icon { width: 38px; height: 38px; object-fit: contain; }
.navbar-user { display: flex; align-items: center; gap: 12px; text-align: right; }
.navbar-user small, .navbar-user strong { display: block; line-height: 1.15; }
.navbar-user small { color: var(--fe-muted); font-size: .72rem; }
.navbar-user strong { color: var(--fe-navy); font-size: .9rem; }
.role-badge { width: 39px; height: 39px; border-radius: 13px; display: grid; place-items: center; }
.role-badge.owner { background: #fff3cd; color: #9a7100; }
.role-badge.collaborator { background: var(--fe-primary-soft); color: var(--fe-primary); }
.hero-panel { background: linear-gradient(135deg, #fff 0%, #faf8ff 100%); border: 1px solid var(--fe-border); border-radius: 22px; padding: 24px 26px; display: flex; justify-content: space-between; align-items: center; gap: 20px; box-shadow: 0 10px 35px rgba(32,41,64,.06); }
.hero-panel h1 { font-size: clamp(1.45rem, 2.4vw, 2.15rem); font-weight: 850; color: var(--fe-navy); letter-spacing: -.04em; }
.eyebrow { color: var(--fe-primary); font-size: .67rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.quick-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.round-action { width: 45px; height: 45px; border: 0; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 7px 17px rgba(32,41,64,.12); transition: .18s ease; }
.round-action:hover { transform: translateY(-2px); }
.round-action.primary { background: var(--fe-primary); color: #fff; }
.round-action.today { background: #e9f2ff; color: #2463a8; }
.round-action.warning { background: #fff0b8; color: #9a7100; }
.round-action.print { background: #e9f8ef; color: #198754; }
.round-action.refresh { background: #eef1f7; color: #47536a; }
.round-action.team { background: #e8f7fa; color: #16758a; }
.round-action.settings { background: #f0eaff; color: var(--fe-primary); }
.round-action.logout { background: #fff0f1; color: var(--fe-danger); }
.round-action.reminder { background: #ffe8d9; color: #b35900; }
.round-action.directory { background: #eef0ff; color: #3b4fb0; }
.round-action.apps { background: #fdeaff; color: #9333ea; }
.pending-count { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--fe-danger); color: #fff; border: 2px solid #fff; font-size: .67rem; display: grid; place-items: center; font-weight: 900; }
.filter-bar { background: #fff; border: 1px solid var(--fe-border); border-radius: 15px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; }
.filter-bar label { font-weight: 800; white-space: nowrap; }
.filter-bar .form-select { width: min(360px, 100%); min-height: 42px; }
.calendar-legend { display: flex; align-items: center; gap: 16px; color: var(--fe-muted); font-size: .82rem; font-weight: 700; }
.calendar-legend span { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-dot.completed { background: var(--fe-primary); }
.legend-dot.pending { background: var(--fe-danger); }
.content-card { background: var(--fe-card); border: 1px solid var(--fe-border); border-radius: 20px; box-shadow: 0 10px 32px rgba(32,41,64,.055); }
.calendar-card { padding: 18px; }
.chart-card { padding: 20px; }
.card-heading h2, .identity-card h2 { margin: 0; color: var(--fe-navy); font-size: 1.15rem; font-weight: 850; }
.chart-wrapper { height: 285px; margin-top: 14px; }
.stats-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--fe-border); }
.stats-summary > div { text-align: center; }
.summary-value { display: block; font-size: 1.55rem; line-height: 1; font-weight: 900; }
.summary-value.completed { color: var(--fe-primary); }
.summary-value.pending { color: var(--fe-danger); }
.summary-value.effectiveness { color: var(--fe-success); }
.stats-summary small { display: block; margin-top: 6px; color: var(--fe-muted); font-size: .72rem; }
.identity-card { padding: 19px; display: flex; align-items: center; gap: 16px; }
.identity-card img { width: 66px; height: 66px; object-fit: contain; border: 1px solid var(--fe-border); border-radius: 16px; background: #fff; padding: 6px; }
.identity-card p:last-child { color: var(--fe-muted); font-size: .86rem; }

/* FullCalendar */
.fc { --fc-border-color: #e5e8f0; --fc-button-bg-color: #6f42c1; --fc-button-border-color: #6f42c1; --fc-button-hover-bg-color: #56309e; --fc-button-hover-border-color: #56309e; --fc-button-active-bg-color: #4e2b91; --fc-today-bg-color: rgba(111,66,193,.07); }
.fc .fc-toolbar-title { color: var(--fe-navy); font-weight: 850; font-size: 1.25rem; text-transform: capitalize; }
.fc .fc-button { border-radius: 9px; font-weight: 750; box-shadow: none !important; }
.fc .fe-extra-button { background: #fff; border: 1px solid var(--fe-border); color: var(--fe-text); }
.fc .fe-extra-button:hover { background: #f4f6fb; }
.fc .fe-po-button { background: var(--fe-primary); border-color: var(--fe-primary); color: #fff; font-weight: 800; }
.fc .fe-po-button:hover { background: var(--fe-primary-dark); border-color: var(--fe-primary-dark); }
.fc .fc-col-header-cell-cushion, .fc .fc-daygrid-day-number { color: #39435a; text-decoration: none; font-weight: 700; }
.fc .fc-event { border-radius: 6px; padding: 1px 4px; font-size: .72rem; font-weight: 800; cursor: pointer; }
.fc .fc-daygrid-day-frame { min-height: 94px; }

/* Modales y registros */
.modal-content { border: 0; border-radius: 20px; box-shadow: 0 25px 70px rgba(27,42,65,.22); overflow: hidden; }
.modal-header, .modal-footer { border-color: var(--fe-border); padding: 18px 22px; }
.modal-body { padding: 22px; }
.modal-title { font-size: 1.3rem; color: var(--fe-navy); font-weight: 850; }

/* .modal-content es flex-column por Bootstrap, y así es como
   .modal-dialog-scrollable logra que solo el body haga scroll (header/
   footer fijos): .modal-body necesita ser hijo flex DIRECTO de
   .modal-content. Varios formularios de esta app envuelven header/body/
   footer en un <form> (para que el submit del botón funcione) -- eso mete
   un nivel de más que rompe esa cadena flex, así que el <form> tiene que
   repetir el mismo flex-column para que .modal-body vuelva a tener una
   altura acotada de la que desbordar. Sin esto, un formulario más alto que
   la ventana simplemente se recorta (overflow:hidden) en vez de dejar
   scroll -- visible sobre todo en formularios largos como el de Horarios. */
.modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.activity-list { display: flex; flex-direction: column; gap: 11px; }
.activity-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; border: 1px solid var(--fe-border); border-radius: 14px; padding: 14px; background: #fff; }
.activity-row.is-pending { border-left: 4px solid var(--fe-danger); }
.activity-row.is-completed { border-left: 4px solid var(--fe-primary); }
.activity-status { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; }
.is-completed .activity-status { background: var(--fe-success-soft); color: var(--fe-success); }
.is-pending .activity-status { background: var(--fe-danger-soft); color: var(--fe-danger); }
.activity-content { min-width: 0; }
.activity-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 7px; }
.type-badge, .assignee-badge, .date-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 8px; font-size: .66rem; font-weight: 850; }
.type-badge { background: var(--fe-primary-soft); color: var(--fe-primary-dark); text-transform: uppercase; }
.type-badge.revision { background: #e7f3ff; color: #2768a7; }
.type-badge.seguimiento { background: #fff6d8; color: #956f00; }
.assignee-badge, .date-badge { background: #f3f5f9; color: var(--fe-muted); }
.activity-description { color: #303a50; line-height: 1.45; overflow-wrap: anywhere; }
.activity-controls { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.empty-state { border: 1px dashed #cdd3df; border-radius: 15px; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--fe-muted); }
.empty-state i { font-size: 2rem; color: #aab1c0; margin-bottom: 10px; }
.empty-state strong { color: var(--fe-text); }
.empty-state span { font-size: .85rem; margin-top: 3px; }
.empty-state.error { color: var(--fe-danger); }
.loading-state { min-height: 120px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; color: var(--fe-muted); }
.type-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.type-option { border: 1px solid var(--fe-border); background: #fff; color: #4b556b; min-height: 48px; display: flex; gap: 7px; align-items: center; justify-content: center; }
.btn-check:checked + .type-option { background: var(--fe-primary-soft); border-color: #bca3f5; color: var(--fe-primary-dark); }
.completed-switch { border: 1px solid var(--fe-border); border-radius: 13px; padding: 13px 15px 13px 48px; background: #fafbfe; }
.completed-switch .form-check-input { margin-left: -33px; width: 2.5em; height: 1.3em; }
.completed-switch label small { display: block; color: var(--fe-muted); }
.future-notice { background: #fff7df; color: #7d620e; border: 1px solid #f3dd96; border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 9px; }

/* Equipo y configuración */
.team-create-card, .settings-section { border: 1px solid var(--fe-border); border-radius: 15px; padding: 17px; background: #fafbfe; }
.team-create-card h3, .settings-section h3 { font-size: 1rem; font-weight: 850; color: var(--fe-navy); margin-bottom: 14px; }
.team-list { display: flex; flex-direction: column; gap: 9px; }
.team-row { display: grid; grid-template-columns: 43px 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--fe-border); border-radius: 13px; padding: 11px 13px; }
.team-avatar { width: 40px; height: 40px; border-radius: 13px; background: var(--fe-primary-soft); color: var(--fe-primary); display: grid; place-items: center; font-weight: 900; }
.team-info strong, .team-info small { display: block; }
.team-info small { color: var(--fe-muted); font-size: .75rem; }
.team-actions { display: flex; gap: 6px; }
.settings-section + .settings-section { margin-top: 16px; }
.storage-usage-bar { height: 12px; border-radius: 999px; background: var(--fe-bg); border: 1px solid var(--fe-border); overflow: hidden; }
.storage-usage-fill { height: 100%; width: 0%; background: var(--fe-primary); border-radius: 999px; transition: width .3s ease, background .3s ease; }
.storage-usage-fill.is-warning { background: var(--fe-warning); }
.storage-usage-fill.is-full { background: var(--fe-danger); }
.storage-usage-text { margin-top: 8px; font-size: .82rem; color: var(--fe-muted); font-weight: 700; }
.storage-usage-text.is-full { color: var(--fe-danger); }
.advanced-catalog-list { display: flex; flex-direction: column; gap: 7px; max-height: 220px; overflow-y: auto; }
.catalog-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--fe-border); border-radius: 11px; padding: 8px 10px; background: #fff; }
.catalog-row.inactive { opacity: .55; }
.catalog-row-name { flex: 1; min-width: 0; font-size: .85rem; font-weight: 750; color: var(--fe-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catalog-row-swatch { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.catalog-row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.catalog-row-actions .form-check.form-switch { margin: 0; padding-left: 2.2em; }
.catalog-row-actions button { border: 0; background: transparent; color: var(--fe-muted); width: 28px; height: 28px; border-radius: 8px; }
.catalog-row-actions button:hover { background: var(--fe-primary-soft); color: var(--fe-primary); }
.catalog-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.catalog-row-main small { color: var(--fe-muted); font-size: .74rem; }
.catalog-row-thumb { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; flex-shrink: 0; background: var(--fe-bg); }
.catalog-row-thumb-empty { display: grid; place-items: center; color: var(--fe-muted); font-size: .95rem; }
.item-image-preview { max-width: 140px; max-height: 140px; border-radius: 12px; border: 1px solid var(--fe-border); object-fit: cover; }
.cost-history-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.cost-history-supplier-card { border: 1px solid var(--fe-border); border-radius: 12px; padding: 10px 12px; min-width: 160px; flex: 1; }
.cost-history-supplier-figures { display: flex; gap: 10px; font-size: .78rem; color: var(--fe-muted); margin-top: 4px; }
.cost-history-chart-wrapper { height: 220px; margin-bottom: 18px; }
.po-lines-card { border: 1px solid var(--fe-border); border-radius: 16px; padding: 16px; background: #fbfbfe; }
.po-lines-heading { margin-bottom: 12px; }
.po-item-search-results { position: relative; border: 1px solid var(--fe-border); border-radius: 12px; background: #fff; margin: -8px 0 12px; max-height: 220px; overflow-y: auto; box-shadow: 0 12px 28px rgba(32,41,64,.10); }
.po-item-search-result { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--fe-border); }
.po-item-search-result:last-child { border-bottom: 0; }
.po-item-search-result:hover { background: var(--fe-primary-soft); }
.po-item-search-result small { color: var(--fe-muted); display: block; }
.po-lines-container { display: flex; flex-direction: column; gap: 10px; }
.po-line-row { display: grid; grid-template-columns: 1.6fr .8fr 1fr 1.4fr 1fr auto; gap: 10px; align-items: end; background: #fff; border: 1px solid var(--fe-border); border-radius: 12px; padding: 10px 12px; }
.po-line-row .po-line-name { font-weight: 750; color: var(--fe-navy); font-size: .86rem; align-self: center; }
.po-line-row .po-line-name small { display: block; color: var(--fe-muted); font-weight: 600; }
.po-line-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.po-line-field-label { font-size: .66rem; font-weight: 700; text-transform: uppercase; color: var(--fe-muted); white-space: nowrap; }
.po-line-tax-group { display: flex; gap: 4px; }
.po-line-tax-group .btn { padding: .28rem .5rem; font-size: .74rem; }
.po-line-total { font-weight: 800; text-align: right; padding: .375rem 0; }
.po-line-remove { border: 0; background: transparent; color: var(--fe-danger); width: 30px; height: 30px; border-radius: 8px; }
.po-line-remove:hover { background: var(--fe-danger-soft); }
.po-totals-card { display: flex; justify-content: flex-end; gap: 22px; border-top: 1px solid var(--fe-border); padding-top: 14px; }
.po-totals-card > div { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.po-totals-card span { color: var(--fe-muted); font-size: .78rem; }
.po-total-grand strong { color: var(--fe-primary); font-size: 1.2rem; }

@media (max-width: 767.98px) {
    .po-line-row { grid-template-columns: 1fr 1fr; }
    .po-line-row .po-line-name { grid-column: 1 / -1; }
    .po-line-field:has(.po-line-total) { grid-column: 1 / -1; }
    .po-line-total { text-align: left; }
}

.po-expenses-month-card { border: 1px solid var(--fe-border); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; background: var(--fe-primary-soft); }
.po-expenses-month-card span { color: var(--fe-muted); font-size: .82rem; font-weight: 700; text-transform: uppercase; }
.po-expenses-month-card strong { font-size: 1.6rem; color: var(--fe-primary); }
.po-expenses-chart-wrapper { height: 240px; margin-bottom: 10px; }
.po-expenses-breakdown { display: flex; flex-direction: column; gap: 6px; }
.po-expenses-breakdown-row { display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--fe-border); border-radius: 10px; padding: 8px 12px; font-size: .85rem; }
.po-expenses-breakdown-row strong { color: var(--fe-navy); }

.collaborator-hub-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:14px; }
.meeting-collaborators-list { max-height:200px; overflow-y:auto; border:1px solid var(--fe-border); border-radius:12px; padding:10px 14px; }

/* Organigrama — árbol clásico en CSS puro (ul/li con conectores), sin librería de diagramas. */
.org-chart-tree, .org-chart-tree ul { list-style:none; margin:0; padding:0; }
.org-chart-tree { display:flex; justify-content:center; padding-top:8px; overflow-x:auto; }
.org-chart-tree ul { display:flex; padding-top:28px; position:relative; }
.org-chart-tree li { position:relative; padding:28px 10px 0; text-align:center; }
.org-chart-tree li::before, .org-chart-tree li::after { content:''; position:absolute; top:0; right:50%; border-top:2px solid var(--fe-border); width:50%; height:28px; }
.org-chart-tree li::after { right:auto; left:50%; border-left:2px solid var(--fe-border); }
.org-chart-tree li:only-child::before, .org-chart-tree li:only-child::after { display:none; }
.org-chart-tree li:only-child { padding-top:0; }
.org-chart-tree li:first-child::before, .org-chart-tree li:last-child::after { border:0 none; }
.org-chart-tree li:last-child::before { border-right:2px solid var(--fe-border); border-radius:0 6px 0 0; }
.org-chart-tree li:first-child::after { border-radius:6px 0 0 0; }
.org-chart-tree ul ul::before { content:''; position:absolute; top:0; left:50%; border-left:2px solid var(--fe-border); width:0; height:28px; }
.org-chart-node-box { display:inline-flex; flex-direction:column; align-items:center; gap:4px; min-width:150px; border:2px solid var(--fe-primary); border-radius:14px; background:#fff; padding:10px 14px; box-shadow:0 8px 20px rgba(32,41,64,.06); }
.org-chart-node-box.org-chart-root { border-color:var(--fe-navy); background:var(--fe-navy); }
.org-chart-node-box.org-chart-root .org-chart-node-level, .org-chart-node-box.org-chart-root .org-chart-node-title { color:#fff; }
.org-chart-node-level { font-size:.68rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--fe-primary); }
.org-chart-node-title { font-weight:800; color:var(--fe-text); }
.org-chart-node-person { font-size:.8rem; color:var(--fe-muted); }
.org-chart-node-person.vacant { font-style:italic; }
.org-chart-node-actions { display:flex; gap:4px; margin-top:4px; }
.org-chart-node-actions .btn { padding:2px 7px; }
.incident-rating-badge { border:1px solid var(--fe-border); border-radius:14px; padding:10px 14px; display:flex; flex-direction:column; gap:2px; background:var(--fe-primary-soft); }
.incident-rating-badge span { font-size:.72rem; font-weight:700; text-transform:uppercase; color:var(--fe-muted); }
.incident-rating-badge strong { font-size:1.3rem; color:var(--fe-primary); }
.incident-summary { display:flex; flex-wrap:wrap; gap:8px; }
.incident-summary .badge { font-size:.78rem; padding:6px 10px; }
.incident-form-card { border:1px solid var(--fe-border); border-radius:16px; padding:16px; background:#fbfbfe; }
.incident-form-card h3 { font-size:1rem; margin-bottom:12px; }

.perf-charts-row { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.perf-chart-block { border:1px solid var(--fe-border); border-radius:16px; padding:16px; background:#fbfbfe; }
.perf-chart-title { font-size:.85rem; text-transform:uppercase; color:var(--fe-muted); margin:0 0 10px; font-weight:700; }
.perf-donut-wrap { position:relative; width:150px; height:150px; margin:0 auto; }
.perf-donut-wrap svg { width:100%; height:100%; transform:rotate(-90deg); }
.perf-donut-center { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.perf-donut-center strong { font-size:1.4rem; color:var(--fe-primary); }
.perf-donut-center span { font-size:.65rem; color:var(--fe-muted); text-transform:uppercase; }
.perf-legend { display:flex; flex-direction:column; gap:6px; font-size:.82rem; margin-top:12px; }
.perf-legend-row { display:flex; align-items:center; gap:8px; }
.perf-legend-swatch { width:10px; height:10px; border-radius:3px; flex-shrink:0; }
.perf-legend-row strong { margin-left:auto; }
.perf-radar-wrap { position:relative; width:100%; max-width:260px; height:210px; margin:0 auto; }
.perf-radar-wrap svg { width:100%; height:100%; overflow:visible; }
.perf-radar-center { position:absolute; left:50%; top:47%; transform:translate(-50%,-50%); display:flex; flex-direction:column; align-items:center; justify-content:center; }
.perf-radar-center strong { font-size:1.3rem; color:var(--fe-primary); }
.perf-radar-center span { font-size:.6rem; color:var(--fe-muted); text-transform:uppercase; }
.perf-metric-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin-top:16px; }
.perf-metric-card { border:1px solid var(--fe-border); border-radius:12px; padding:12px 14px; background:#fff; }
.perf-metric-card h3 { font-size:.78rem; text-transform:uppercase; color:var(--fe-muted); margin:0 0 8px; display:flex; justify-content:space-between; align-items:center; }
.perf-metric-card h3 strong { color:var(--fe-primary); font-size:.95rem; }
.perf-metric-card ul { margin:0; padding:0; list-style:none; font-size:.8rem; color:#333; }
.perf-metric-card li { display:flex; justify-content:space-between; gap:10px; padding:4px 0; border-bottom:1px dotted #eceff5; }
.perf-metric-card li:last-child { border-bottom:0; }
.perf-note { font-size:.78rem; color:var(--fe-muted); margin-top:8px; }
.perf-empty { padding:14px; text-align:center; color:var(--fe-muted); border:1px dashed var(--fe-border); border-radius:10px; font-size:.85rem; }

@media (max-width: 767.98px) {
    .perf-charts-row { grid-template-columns:1fr; }
}

@media (max-width: 991.98px) {
    .hero-panel { align-items: flex-start; flex-direction: column; }
    .quick-actions { justify-content: flex-start; }
    .filter-bar { flex-wrap: wrap; }
    .filter-bar .form-select { width: 100%; }
    .calendar-legend { margin-left: 0 !important; }
}

@media (max-width: 767.98px) {
    .auth-card { padding: 24px 19px; border-radius: 19px; }
    .landing-grid { grid-template-columns: 1fr; }
    .hero-panel { padding: 19px; }
    .round-action { width: 42px; height: 42px; }
    .calendar-card { padding: 9px; overflow-x: auto; }
    .fc { min-width: 650px; }
    .activity-row { grid-template-columns: 32px 1fr; }
    .activity-controls { grid-column: 1 / -1; justify-content: flex-end; }
    .type-selector { grid-template-columns: 1fr; }
    .stats-summary { gap: 4px; }
    .summary-value { font-size: 1.25rem; }
    .modal-body { padding: 17px; }
}


.permission-create-switch,
.collaborator-review-notice { border: 1px solid rgba(111,66,193,.2); background: #f7f3ff; }
.permission-create-switch { border-radius: 13px; padding: 13px 15px 13px 48px; }
.permission-create-switch .form-check-input { margin-left: -32px; }
.permission-create-switch strong,
.permission-create-switch small { display: block; }
.permission-create-switch small { color: var(--fe-muted); font-size: .78rem; margin-top: 2px; }
.permission-state { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; padding: 3px 8px; border-radius: 999px; font-size: .68rem; font-weight: 750; }
.permission-state.allowed { background: #e9f8ef; color: #198754; }
.permission-state.blocked { background: #f0f1f4; color: #6c757d; }
.review-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: #fff3cd; color: #8a6100; font-size: .7rem; font-weight: 750; }
.collaborator-review-notice { color: #4f397f; }
@media (max-width: 575.98px) {
    .team-row { grid-template-columns: 40px 1fr; }
    .team-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Búsqueda y duplicación de actividades - v0.1.5 */
.filter-field { display: flex; align-items: center; gap: 10px; min-width: 0; }
.responsible-filter { flex: 0 1 455px; }
.responsible-filter .form-select { width: min(300px, 100%); }
.activity-search-field { flex: 1 1 430px; }
.activity-search-group { min-width: 260px; flex-wrap: nowrap; }
.activity-search-group .form-control { min-width: 0; }
.activity-search-group .btn { white-space: nowrap; }
.search-summary { color: var(--fe-muted); font-size: .82rem; margin-top: 3px; }
.match-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 8px; background: #e8f7ee; color: #167347; font-size: .66rem; font-weight: 850; }
.copy-source-card { text-align: left; border: 1px solid var(--fe-border); border-left: 4px solid var(--fe-primary); border-radius: 13px; background: #faf9ff; padding: 13px 14px; margin: 4px 0 14px; color: var(--fe-text); }
.copy-source-card > div { color: var(--fe-muted); font-size: .79rem; margin-bottom: 3px; }
.copy-source-card p { margin: 9px 0 0; max-height: 130px; overflow-y: auto; line-height: 1.42; }
.copy-date-label { display: block; text-align: left; color: var(--fe-navy); font-weight: 850; margin: 5px auto 4px; width: min(100%, 22rem); }
.swal2-input.copy-date-input { display: block; width: min(100%, 22rem); margin: 0 auto 5px; }
.copy-help { display: block; width: min(100%, 22rem); margin: 0 auto; color: var(--fe-muted); text-align: left; }
.swal2-textarea.copy-reason-input { display: block; width: min(100%, 22rem); margin: 0 auto 5px; min-height: 90px; }
.postpone-note { margin-top: 8px; padding: 8px 10px; background: #fff7e0; border: 1px solid #f0d77a; border-radius: 10px; color: #6a5200; font-size: .78rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.postpone-note i { color: #9a7100; }
.postpone-note.postpone-request-rejected { background: #fdecea; border-color: #f3b4ac; color: #7a1f13; }
.postpone-note.postpone-request-rejected i { color: #b3261e; }

/* Este modal solo se abre "encima" de otro (Detalle del pago/cobro, que a su
   vez puede seguir teniendo el de Día/Búsqueda detrás) -- Bootstrap no
   reordena los <div class="modal"> al mostrarlos, respeta su posición en el
   HTML, así que sin esto puede terminar detrás de un modal escrito después
   en la página aunque se haya abierto último. Se fuerza siempre arriba. */
#paymentSeriesProfileModal { z-index: 1080; }
.postpone-history-link { border: 0; background: transparent; color: #6f42c1; font-weight: 800; font-size: .76rem; text-decoration: underline; padding: 0; margin-left: auto; cursor: pointer; }
.postpone-history-list { list-style: decimal; text-align: left; margin: 0; padding-left: 18px; width: min(100%, 26rem); }
.postpone-history-list li { margin-bottom: 10px; }
.postpone-history-list li.is-current strong { color: var(--fe-primary); }
.postpone-history-reason { color: var(--fe-muted); font-size: .82rem; margin-top: 2px; }
.postpone-history-current-badge { display: inline-block; background: #eee7fb; color: #593299; border-radius: 999px; padding: 1px 8px; font-size: .68rem; font-weight: 800; margin-left: 6px; }

@media (max-width: 1199.98px) {
    .filter-bar { align-items: stretch; }
    .filter-field { flex-direction: column; align-items: stretch; gap: 6px; }
    .responsible-filter, .activity-search-field { flex: 1 1 330px; }
    .responsible-filter .form-select { width: 100%; }
    .calendar-legend { width: 100%; }
}

@media (max-width: 767.98px) {
    .filter-field, .responsible-filter, .activity-search-field { width: 100%; flex-basis: 100%; }
    .activity-search-group { min-width: 0; }
    .activity-search-group .btn span { display: none !important; }
}

/* Calendario de pagos - v0.2.0 */
.module-switch-panel {
    display: grid;
    grid-template-columns: minmax(310px, .72fr) minmax(420px, 1.28fr);
    gap: 16px;
    background: #fff;
    border: 1px solid var(--fe-border);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 9px 28px rgba(32,41,64,.05);
}
.module-switch-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.module-switch {
    min-height: 58px;
    border: 1px solid var(--fe-border);
    border-radius: 14px;
    background: #f8f9fc;
    color: #536078;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 13px;
    font-weight: 850;
    transition: .18s ease;
}
.module-switch i { font-size: 1.05rem; }
a.module-switch { text-decoration: none; }
.module-switch:hover { border-color: #bda8ee; color: var(--fe-primary); }
.module-switch.active { background: var(--fe-primary); border-color: var(--fe-primary); color: #fff; box-shadow: 0 8px 20px rgba(111,66,193,.22); }
.today-payment-strip { min-width: 0; border-left: 1px solid var(--fe-border); padding-left: 16px; }
.today-payment-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--fe-navy); font-size: .82rem; font-weight: 850; margin-bottom: 8px; }
.today-payment-heading strong { color: var(--fe-danger); font-size: .95rem; white-space: nowrap; }
.today-payment-carousel-wrap { display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: center; gap: 7px; }
.today-payment-carousel { display: flex; gap: 9px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; min-height: 70px; }
.today-payment-carousel::-webkit-scrollbar { display: none; }
.carousel-arrow { width: 30px; height: 30px; border: 1px solid var(--fe-border); border-radius: 50%; background: #fff; color: var(--fe-primary); display: grid; place-items: center; }
.carousel-arrow:hover { background: var(--fe-primary-soft); }
.payment-carousel-item { flex: 0 0 min(285px, 86%); scroll-snap-align: start; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: center; border: 1px solid #f0c6cb; border-left: 4px solid var(--fe-danger); border-radius: 12px; background: #fff8f8; padding: 9px 11px; }
.payment-carousel-item strong, .payment-carousel-item span, .payment-carousel-item small { display: block; }
.payment-carousel-item strong { color: var(--fe-danger); font-size: .93rem; }
.payment-carousel-item span { color: var(--fe-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .78rem; font-weight: 750; }
.payment-carousel-item small { color: var(--fe-muted); font-size: .67rem; margin-top: 2px; }
.payment-carousel-empty { width: 100%; min-height: 62px; display: flex; align-items: center; justify-content: center; color: var(--fe-muted); border: 1px dashed var(--fe-border); border-radius: 12px; padding: 10px; font-size: .8rem; }
.legend-dot.paid { background: var(--fe-success); }
.payment-static-responsible { display: flex; align-items: center; background: #f7f8fb; color: var(--fe-text); width: min(300px, 100%); }
.payment-calendar-card .fc { --fc-today-bg-color: rgba(25,135,84,.07); }
.payment-stats-summary .summary-value { font-size: clamp(.98rem, 1.5vw, 1.3rem); overflow-wrap: anywhere; }
.summary-value.paid { color: var(--fe-success); }
.summary-value.total { color: var(--fe-navy); }
.payment-info-card { padding: 19px; display: flex; align-items: flex-start; gap: 14px; }
.payment-info-card h2 { margin: 0 0 5px; color: var(--fe-navy); font-size: 1.1rem; font-weight: 850; }
.payment-info-card p:last-child { color: var(--fe-muted); font-size: .81rem; line-height: 1.45; }
.payment-info-icon { flex: 0 0 48px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: var(--fe-primary-soft); color: var(--fe-primary); font-size: 1.2rem; }
.payment-row.is-paid { border-left: 4px solid var(--fe-success); }
.payment-row.is-paid .activity-status { background: var(--fe-success-soft); color: var(--fe-success); }
.payment-main-line { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.payment-amount { color: var(--fe-navy); font-size: 1.05rem; }
.payment-status-text { padding: 2px 7px; border-radius: 999px; font-size: .65rem; font-weight: 850; text-transform: uppercase; background: var(--fe-danger-soft); color: var(--fe-danger); }
.is-paid .payment-status-text { background: var(--fe-success-soft); color: var(--fe-success); }
.type-badge.payment-type { background: #eef3ff; color: #315c9a; }
.payment-paid-switch { border-color: rgba(25,135,84,.22); background: #f4fbf7; }
#paymentRepeatGroup .form-text { line-height: 1.3; }
.payment-list .activity-controls { max-width: 185px; }

@media (max-width: 1099.98px) {
    .module-switch-panel { grid-template-columns: 1fr; }
    .today-payment-strip { border-left: 0; border-top: 1px solid var(--fe-border); padding-left: 0; padding-top: 13px; }
}

@media (max-width: 575.98px) {
    .module-switch-panel { padding: 11px; }
    .module-switch-buttons { grid-template-columns: 1fr; }
    .module-switch { min-height: 48px; }
    .today-payment-carousel-wrap { grid-template-columns: 26px minmax(0, 1fr) 26px; }
    .carousel-arrow { width: 26px; height: 26px; }
    .payment-carousel-item { flex-basis: 92%; }
    .payment-main-line { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* Advertencia de cierre automático por inactividad */
.idle-session-warning {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1095;
    width: min(390px, calc(100vw - 32px));
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 193, 7, .55);
    border-radius: 16px;
    background: rgba(255, 252, 235, .98);
    box-shadow: 0 16px 45px rgba(27, 42, 65, .22);
    color: #5f4700;
    animation: idleWarningEnter .2s ease-out;
}

.idle-session-warning__icon {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ffc107;
    color: #503b00;
    font-size: 1.25rem;
}

.idle-session-warning__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.idle-session-warning__content strong {
    color: #392b00;
    font-size: .98rem;
}

.idle-session-warning__content span {
    margin-top: 3px;
    font-size: .9rem;
}

.idle-session-warning__content small {
    margin-top: 5px;
    color: #79631b;
    font-size: .76rem;
}

#idleSessionCountdown {
    display: inline-block;
    min-width: 44px;
    font-variant-numeric: tabular-nums;
}

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

@media (max-width: 575.98px) {
    .idle-session-warning {
        right: 16px;
        bottom: 16px;
        padding: 14px;
    }
}

/* Editor de pagos recurrentes v0.2.2 */
.payment-edit-scope {
    width: min(100%, 22rem);
    margin: 12px auto 0;
    padding-top: 10px;
    border-top: 1px solid rgba(35, 45, 72, .10);
}
.payment-edit-scope .swal2-select {
    width: 100%;
    margin: 0 0 5px;
}

/* ================================================================
   Flawless Execution v1.0.0 — Calendario programado y flujo avanzado
   ================================================================ */
.round-action.executive { background: #0f766e; color: #fff; }
.round-action.executive:hover { background: #115e59; }
.module-switch-buttons { flex-wrap: wrap; }
.module-switch { min-width: 190px; }
body[data-active-module="scheduled"] .today-payment-strip { opacity: .72; }

.scheduled-filter-bar { align-items: end; }
.scheduled-today-strip {
    background: linear-gradient(135deg, #171f38 0%, #24385d 100%);
    color: #fff; border-radius: 22px; padding: 18px 20px;
    box-shadow: 0 16px 36px rgba(27, 42, 65, .17);
}
.scheduled-today-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:12px; }
.scheduled-today-heading h2 { margin:0; font-size:1.15rem; }
.scheduled-today-count { min-width:42px; height:42px; border-radius:50%; display:grid; place-items:center; background:#6f42c1; font-weight:800; }
.scheduled-today-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:10px; }
.scheduled-today-item { border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.08); color:#fff; border-radius:15px; padding:12px; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px; text-align:left; transition:.18s ease; }
.scheduled-today-item:hover { background:rgba(255,255,255,.15); transform:translateY(-1px); }
.scheduled-today-item strong,.scheduled-today-item small { display:block; }
.scheduled-today-item small { color:rgba(255,255,255,.68); margin-top:2px; }
.scheduled-today-status { font-size:.65rem; }
.scheduled-today-status.status-aprobada { color:#b794f4; }
.scheduled-today-status.status-terminada { color:#52d39a; }
.scheduled-today-status.status-pendiente,.scheduled-today-status.status-rechazada { color:#ff7b86; }
.priority-mini { font-size:.7rem; font-weight:800; text-transform:uppercase; padding:4px 7px; border-radius:999px; background:rgba(255,255,255,.12); }

.legend-dot.scheduled-approved { background:#6f42c1; }
.legend-dot.scheduled-completed { background:#198754; }
.legend-dot.scheduled-rejected { background:#ffc107; }
.scheduled-info-card { display:flex; gap:16px; align-items:flex-start; }
.scheduled-info-icon { width:54px; height:54px; border-radius:16px; display:grid; place-items:center; background:#eee7fb; color:#6f42c1; font-size:1.4rem; flex:0 0 auto; }
.scheduled-info-card h2 { font-size:1.12rem; margin-bottom:6px; }
.completed-green { color:#198754 !important; }
.summary-value.urgent { color:#dc3545; }
.scheduled-stats-summary { grid-template-columns:repeat(4,1fr); }

.activity-row.status-aprobada { border-left-color:#6f42c1; }
.activity-row.status-terminada { border-left-color:#198754; }
.activity-row.status-rechazada { border-left-color:#ffc107; }
.activity-row.status-omitida { border-left-color:#6c757d; opacity:.8; }
.activity-row.status-pendiente { border-left-color:#dc3545; }
.activity-row.is-overdue { box-shadow:inset 0 0 0 1px rgba(220,53,69,.18), 0 8px 20px rgba(220,53,69,.08); }
.scheduled-status-icon { background:#f3effa; color:#6f42c1; }
.status-pendiente .scheduled-status-icon,.is-overdue .scheduled-status-icon { background:#fff0f1; color:#dc3545; }
.status-terminada .scheduled-status-icon { background:#eaf8f0; color:#198754; }
.status-rechazada .scheduled-status-icon { background:#fff9e6; color:#9a7200; }
.status-omitida .scheduled-status-icon { background:#eef0f2; color:#6c757d; }
.scheduled-item-title { font-size:1.02rem; margin:.45rem 0 .25rem; color:#202a42; }
.priority-badge,.workflow-badge,.project-badge,.evidence-required-badge,.comment-badge { display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:4px 8px; font-size:.72rem; font-weight:700; }
.priority-baja { background:#f1f3f5; color:#596273; }
.priority-media { background:#e8f1ff; color:#245b9f; }
.priority-alta { background:#fff0df; color:#a55300; }
.priority-urgente { background:#ffe4e7; color:#b42332; }
.workflow-badge.status-pendiente { background:#ffe8ea; color:#b42332; }
.workflow-badge.status-terminada { background:#e3f6eb; color:#11683c; }
.workflow-badge.status-aprobada { background:#eee7fb; color:#593299; }
.workflow-badge.status-rechazada { background:#fff4cc; color:#765600; }
.workflow-badge.status-omitida { background:#e9ecef; color:#59616b; }
.project-badge { background:#eef5ff; color:#315f94; }
.evidence-required-badge { background:#f1edf8; color:#6f42c1; }
.comment-badge { background:#e8f1ff; color:#245b9f; }
.rejection-message { margin-top:10px; background:#fff7d6; border:1px solid #f0d77a; color:#6a5200; padding:10px 12px; border-radius:12px; }

.advanced-switch-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.advanced-switch-grid .form-check { border:1px solid #e5e9f2; border-radius:14px; padding:14px 14px 14px 48px; background:#fbfcff; }
.advanced-switch-grid small { display:block; color:#7a8394; font-weight:400; }
.weekday-assignment-card { border:1px solid #e1e6f0; border-radius:18px; padding:18px; background:#f9fbff; }
.weekday-assignment-heading { display:flex; justify-content:space-between; align-items:end; gap:20px; margin-bottom:14px; }
.weekday-assignment-heading h3 { font-size:1.08rem; margin:0; }
.weekday-assignment-heading small { color:#7a8394; }

/* Directorio */
.directory-contact-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--fe-border); border-radius: 14px; padding: 10px 12px; background: #fff; margin-bottom: 8px; }
.directory-contact-photo { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; overflow: hidden; background: var(--fe-bg); display: grid; place-items: center; color: var(--fe-muted); font-size: 1.1rem; }
.directory-contact-photo img { width: 100%; height: 100%; object-fit: cover; }
.directory-contact-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.directory-contact-name { font-weight: 750; color: var(--fe-navy); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.directory-contact-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .78rem; color: var(--fe-muted); }
.directory-contact-meta span { display: inline-flex; align-items: center; gap: 5px; }
.directory-contact-phones { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.directory-phone-row { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--fe-navy); }
.directory-phone-row a { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border-radius: 8px; }
.directory-contact-actions { flex-shrink: 0; }
.classification-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.classification-cliente { background: #e8f1ff; color: #245b9f; }
.classification-proveedor { background: #fff0df; color: #a55300; }
.classification-colaborador { background: #e8f7fa; color: #16758a; }
.classification-personal { background: #f1edf8; color: #6f42c1; }
.directory-company-combobox { position: relative; }
.directory-suggestions-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); border: 1px solid var(--fe-border); border-radius: 12px; background: #fff; max-height: 220px; overflow-y: auto; box-shadow: 0 12px 28px rgba(32,41,64,.12); }
.directory-suggestion-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 12px; font-size: .85rem; color: var(--fe-navy); border-bottom: 1px solid var(--fe-border); }
.directory-suggestion-item:last-child { border-bottom: 0; }
.directory-suggestion-item:hover { background: var(--fe-primary-soft); }
.directory-suggestion-empty { padding: 8px 12px; font-size: .78rem; color: var(--fe-muted); }
.directory-photo-picker { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.directory-photo-preview-wrap { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: var(--fe-bg); display: grid; place-items: center; color: var(--fe-muted); font-size: 1.6rem; flex-shrink: 0; border: 1px solid var(--fe-border); position: relative; }
.directory-photo-preview-wrap img { width: 100%; height: 100%; object-fit: cover; }
.directory-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.directory-location-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--fe-bg); border: 1px solid var(--fe-border); border-radius: 999px; padding: 6px 10px; font-size: .8rem; margin-top: 8px; }
.directory-location-chip a { font-weight: 700; }
.directory-clickable-name { cursor: pointer; }
.directory-clickable-name:hover { text-decoration: underline; color: var(--fe-primary); }
.directory-filter-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--fe-primary-soft); color: var(--fe-primary); border-radius: 999px; padding: 6px 12px; font-size: .8rem; font-weight: 700; margin-bottom: 12px; }
.directory-filter-chip button { color: inherit; }
.directory-detail { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.directory-detail-photo { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: var(--fe-bg); display: grid; place-items: center; color: var(--fe-muted); font-size: 2rem; margin-bottom: 4px; }
.directory-detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.directory-detail-name { font-size: 1.1rem; font-weight: 800; color: var(--fe-navy); }
.directory-detail-row { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--fe-navy); width: 100%; justify-content: center; flex-wrap: wrap; }
.directory-detail-notes { margin-top: 6px; padding: 10px 12px; background: var(--fe-bg); border-radius: 10px; font-size: .82rem; color: var(--fe-navy); text-align: left; width: 100%; white-space: pre-wrap; }
.directory-call-preview { background: var(--fe-primary-soft); color: var(--fe-primary); border-radius: 10px; padding: 10px 12px; font-size: .84rem; font-weight: 600; min-height: 20px; }
.directory-camera-frame { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.directory-camera-frame video, .directory-camera-frame canvas { width: 100%; height: 100%; object-fit: cover; }
.directory-camera-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; padding: 20px; background: rgba(0,0,0,.55); font-size: .9rem; }

/* Notificaciones diarias (Configuración > Pushover) */
.notify-summary-card { border: 1px solid var(--fe-border); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; background: #fbfcff; }
.notify-summary-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.notify-summary-time { width: 130px; }
.notify-days-row { display: flex; gap: 6px; margin-top: 8px; }
.notify-day-checkbox { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; color: var(--fe-muted); cursor: pointer; }
.notify-day-checkbox input { margin: 0; }
.notify-pause-status { display: inline-flex; align-items: center; background: #fff3cd; color: #8a6100; border-radius: 999px; padding: 6px 12px; font-size: .82rem; font-weight: 700; margin-bottom: 10px; }
@media (max-width: 575.98px) {
    .directory-contact-row { flex-wrap: wrap; }
    .directory-contact-phones { flex-direction: row; flex-wrap: wrap; }
}
.weekday-assignment-grid { display:grid; gap:9px; }
.weekday-assignment-row { display:grid; grid-template-columns:120px 1fr; gap:12px; align-items:center; }
.weekday-name { font-weight:750; color:#34405a; }
.edit-scope-card { border:1px dashed #a58bd3; background:#f7f2ff; border-radius:15px; padding:14px; }
.edit-scope-card .form-check { margin-top:8px; }

.template-list { display:grid; gap:12px; }
.template-row { display:flex; justify-content:space-between; gap:20px; align-items:center; border:1px solid #e4e8f0; border-radius:18px; padding:16px; background:#fff; }
.template-row.is-inactive { opacity:.65; background:#f7f8fa; }
.template-main h3 { margin:8px 0 4px; font-size:1.05rem; }
.template-main p { margin:0 0 5px; color:#657087; font-size:.85rem; }
.template-main small { color:#8991a0; }
.template-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:end; }

.detail-hero { display:flex; justify-content:space-between; gap:22px; padding:20px; border-radius:18px; background:#f7f8fc; border-left:6px solid #6f42c1; }
.detail-hero.status-pendiente { border-left-color:#dc3545; }
.detail-hero.status-terminada { border-left-color:#198754; }
.detail-hero.status-rechazada { border-left-color:#ffc107; }
.detail-hero.status-omitida { border-left-color:#6c757d; }
.detail-hero h3 { margin:10px 0 4px; font-size:1.15rem; }
.detail-hero p { margin:0; color:#566078; }
.detail-actions { display:flex; flex-wrap:wrap; gap:8px; align-content:flex-start; justify-content:end; min-width:210px; }
.detail-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-top:16px; }
.detail-grid > div { border:1px solid #e5e9f1; border-radius:14px; padding:12px; background:#fff; }
.detail-grid strong,.detail-grid span { display:block; }
.detail-grid strong { font-size:.72rem; color:#848c9c; text-transform:uppercase; letter-spacing:.04em; }
.detail-grid span { margin-top:4px; font-weight:650; color:#2f3951; }
.detail-section { border:1px solid #e3e8f0; border-radius:18px; padding:16px; background:#fff; height:100%; }
.detail-section h4 { font-size:1rem; margin-bottom:14px; }
.evidence-list,.comment-list,.history-list { display:grid; gap:9px; max-height:320px; overflow:auto; }
.evidence-item { display:flex; gap:10px; align-items:center; border:1px solid #e6e9ef; padding:10px; border-radius:12px; color:#33405a; text-decoration:none; }
.evidence-item:hover { border-color:#8060bc; background:#faf8ff; }
.evidence-item i { color:#6f42c1; }
.evidence-item small { display:block; color:#8a91a0; }
.comment-item { background:#f7f9fc; padding:10px 12px; border-radius:12px; }
.comment-item p { margin:4px 0; }
.comment-item small { color:#8b92a1; }
.history-item { border-left:3px solid #d6c7ee; padding:7px 10px; background:#faf9fd; border-radius:0 10px 10px 0; }
.history-item span,.history-item small { display:block; }
.history-item span { font-weight:700; text-transform:capitalize; }
.history-item small { color:#8b92a1; }
.history-item p { margin:4px 0 0; font-size:.82rem; color:#60697b; }
.evidence-upload-label { display:block; text-align:left; margin:12px 1.6em 0; color:#5d6678; font-size:.85rem; }
.evidence-upload-label input { margin-top:6px; }

.executive-kpi-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.executive-kpi { border:1px solid #e4e8f0; border-radius:18px; padding:18px; background:linear-gradient(160deg,#fff,#f7f9fd); }
.executive-kpi > i { width:40px; height:40px; display:grid; place-items:center; border-radius:12px; background:#eee7fb; color:#6f42c1; margin-bottom:14px; }
.executive-kpi span,.executive-kpi strong,.executive-kpi small { display:block; }
.executive-kpi span { color:#70798b; font-size:.82rem; }
.executive-kpi strong { font-size:1.55rem; color:#202a42; margin:4px 0; }
.executive-kpi small { color:#858d9b; }
.executive-team-section { margin-top:22px; }
.executive-team-section h3 { font-size:1.08rem; margin-bottom:12px; }
.executive-team-list { display:grid; gap:9px; }
.executive-team-row { display:grid; grid-template-columns:minmax(160px,1fr) 2fr 54px; align-items:center; gap:14px; border:1px solid #e5e8ef; padding:10px 12px; border-radius:13px; }
.executive-team-row strong,.executive-team-row small { display:block; }
.executive-team-row small { color:#858d9b; }
.executive-team-row .progress { height:9px; }
.executive-team-row .progress-bar { background:#6f42c1; }

.advanced-edit-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; text-align:left; }
.advanced-edit-grid label { font-size:.82rem; color:#606a7e; }
.advanced-edit-grid .form-control,.advanced-edit-grid .form-select { margin-top:4px; }
.advanced-edit-grid .span-2 { grid-column:span 2; }
.advanced-settings-launch { background:linear-gradient(135deg,#f4effc,#f7fbff); }

@media (max-width: 991px) {
    .scheduled-stats-summary { grid-template-columns:repeat(2,1fr); }
    .advanced-switch-grid,.executive-kpi-grid { grid-template-columns:1fr 1fr; }
    .detail-grid { grid-template-columns:1fr 1fr; }
    .detail-hero { flex-direction:column; }
    .detail-actions { justify-content:flex-start; }
}
@media (max-width: 640px) {
    .module-switch { min-width:100%; }
    .scheduled-today-list { grid-template-columns:1fr; }
    .advanced-switch-grid,.executive-kpi-grid,.detail-grid { grid-template-columns:1fr; }
    .weekday-assignment-row { grid-template-columns:1fr; }
    .template-row { flex-direction:column; align-items:stretch; }
    .template-actions { justify-content:flex-start; }
    .executive-team-row { grid-template-columns:1fr; }
    .advanced-edit-grid { grid-template-columns:1fr; }
    .advanced-edit-grid .span-2 { grid-column:span 1; }
}

/* Complementos administrativos y de evidencia v1.0.0 */
.tag-chip-row { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.tag-chip { --tag-color:#6f42c1; display:inline-flex; align-items:center; gap:5px; padding:4px 9px; border-radius:999px; border:1px solid color-mix(in srgb, var(--tag-color) 38%, white); background:color-mix(in srgb, var(--tag-color) 11%, white); color:var(--tag-color); font-size:.72rem; font-weight:750; }
.tag-chip::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--tag-color); }
.meta-badge { display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:4px 8px; font-size:.72rem; font-weight:700; background:#edf4fb; color:#315f7e; }
.punch-badge { display:inline-flex; align-items:center; border-radius:999px; padding:4px 9px; font-size:.72rem; font-weight:700; background:#f3f5f9; color:#3f4a60; border:1px solid #e1e5ee; }
.detail-description { margin-top:14px; padding:14px 16px; border-radius:14px; background:#f7f9fc; color:#3f4a60; line-height:1.5; }
.section-heading { display:flex; justify-content:space-between; align-items:end; gap:16px; margin-bottom:12px; }
.section-heading h3 { margin:0; font-size:1rem; }
.section-heading span { color:#828b9d; font-size:.75rem; }
.evidence-upload-form { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; }
.evidence-row { display:flex; justify-content:space-between; align-items:center; gap:12px; border:1px solid #e4e8ef; padding:10px 12px; border-radius:12px; }
.evidence-row > div { display:grid; grid-template-columns:auto 1fr; gap:3px 9px; align-items:center; min-width:0; }
.evidence-row i { grid-row:1/3; color:#6f42c1; }
.evidence-row a { color:#2f3a52; font-weight:700; overflow-wrap:anywhere; }
.evidence-row small { color:#858e9f; font-size:.72rem; }
.empty-state.compact { min-height:110px; padding:20px; }
.swal-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px 12px; text-align:left; }
.swal-form-grid > div { min-width:0; }
.swal-form-grid .span-2 { grid-column:span 2; }
.swal-form-grid label { display:block; margin:0 0 4px; color:#5f687a; font-size:.8rem; font-weight:700; }
.swal-form-grid .swal2-input,.swal-form-grid .swal2-select,.swal-form-grid .swal2-textarea { width:100%; margin:0; }
.admin-link-grid { display:flex; flex-wrap:wrap; gap:9px; }
.admin-page { min-height:100vh; background:linear-gradient(160deg,#f4f6fb 0%,#eef2f8 100%); color:#202a42; }
.admin-page-header { display:flex; align-items:center; gap:18px; margin-bottom:24px; }
.admin-page-header h1 { margin:0; font-size:clamp(1.55rem,3vw,2.25rem); }
.admin-content-card { padding:24px; }
.admin-content-card h2 { font-size:1.15rem; }
.audit-details { max-width:420px; white-space:normal; overflow-wrap:anywhere; font-size:.82rem; }
.report-feature-icon { width:52px; height:52px; border-radius:16px; display:grid; place-items:center; background:#eee7fb; color:#6f42c1; font-size:1.35rem; margin-bottom:16px; }

.po-hub-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:12px; }
.po-hub-tile { display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center; padding:20px 10px; border:1px solid var(--fe-border); border-radius:16px; background:#fff; cursor:pointer; transition:.18s ease; color:var(--fe-text); min-width:0; }
.po-hub-tile:hover { transform:translateY(-3px); box-shadow:0 12px 28px rgba(32,41,64,.12); border-color:#cbb8ff; color:var(--fe-text); }
.po-hub-tile-icon { width:58px; height:58px; border-radius:16px; display:grid; place-items:center; font-size:1.4rem; color:#fff; flex-shrink:0; background:var(--fe-primary); }
.po-hub-tile span { font-weight:800; font-size:.92rem; line-height:1.2; word-break:break-word; }

@media (max-width:575.98px) {
    .po-hub-grid { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; }
    .po-hub-tile { flex:0 0 calc(50% - 5px); padding:14px 6px; }
    .po-hub-tile-icon { width:48px; height:48px; font-size:1.15rem; }
    .po-hub-tile span { font-size:.8rem; }
}

@media (min-width:576px) {
    /* auto-fit con un mínimo de 130px por columna -- en un modal ancho
       (varios tiles, ej. Apps) siguen cabiendo varias columnas; en uno más
       angosto con pocos tiles (ej. Asistencia), cada tile crece en vez de
       apretarse en 5 columnas fijas que ya no entraban el texto. */
    .po-hub-grid { grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); }
}

@supports not (color: color-mix(in srgb, red 50%, white)) {
    .tag-chip { border-color:#d8caef; background:#f4effc; }
}

@media (max-width:640px) {
    .evidence-upload-form { grid-template-columns:1fr; }
    .swal-form-grid { grid-template-columns:1fr; }
    .swal-form-grid .span-2 { grid-column:span 1; }
    .admin-page-header { align-items:flex-start; flex-direction:column; }
    .admin-link-grid .btn { width:100%; }
}
