/* Identidad de marca Felix00 / 00Rec aplicada al portal interno.
   Reutiliza la paleta y tipografía de la plantilla pública (fondo oscuro,
   Poppins/Montserrat, acento dorado) para que el portal se vea como parte
   del mismo sistema. */

:root {
    --bs-primary: #ffc107;
    --bs-primary-rgb: 255, 193, 7;
    --f00-dark: #121212;
    --f00-dark-light: #1e1e1e;
    --f00-border: rgba(255, 255, 255, 0.1);
    --f00-topbar-h: 104px;
}

body {
    background-color: var(--f00-dark);
    color: #f1f1f1;
    font-family: 'Poppins', 'Segoe UI', Roboto, Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-weight: 700;
}

a {
    color: #ffc107;
}

a:hover {
    color: #ffd966;
}

.text-primary {
    color: #ffc107 !important;
}

.border-primary {
    border-color: #ffc107 !important;
}

.text-muted {
    color: #adb5bd !important;
}

hr {
    border-color: var(--f00-border);
    opacity: 1;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%) !important;
}

.navbar-brand img {
    height: 76px;
    margin: 0 .5rem 0 1.25rem;
}

.navbar-brand {
    font-size: 1.6rem;
}

/* Botones */
.btn-primary {
    --bs-btn-color: #000;
    --bs-btn-hover-color: #000;
    --bs-btn-active-color: #000;
    --bs-btn-bg: #ffc107;
    --bs-btn-border-color: #ffc107;
    --bs-btn-hover-bg: #e0a800;
    --bs-btn-hover-border-color: #e0a800;
    --bs-btn-active-bg: #e0a800;
    --bs-btn-active-border-color: #e0a800;
    --bs-btn-disabled-bg: #ffc107;
    --bs-btn-disabled-border-color: #ffc107;
}

/* Tarjetas */
.card {
    background-color: var(--f00-dark-light);
    color: #f1f1f1;
    border-color: var(--f00-border);
}

.card-header {
    background-color: rgba(255, 255, 255, 0.04);
    border-bottom-color: var(--f00-border);
}

/* Listas */
.list-group-item {
    background-color: transparent;
    color: #f1f1f1;
    border-color: var(--f00-border);
}

/* Tablas — !important porque las utilidades bg-* de Bootstrap ya vienen
   marcadas !important y si alguna vista las reintroduce, deben perder. */
.table {
    color: #f1f1f1;
    background-color: var(--f00-dark-light) !important;
}

.table > :not(caption) > * > * {
    background-color: transparent;
    color: #f1f1f1;
    border-bottom-color: var(--f00-border);
    box-shadow: none;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* Formularios */
.form-control, .form-select {
    background-color: var(--f00-dark-light);
    border-color: var(--f00-border);
    color: #f1f1f1;
}

.form-control:focus, .form-select:focus {
    background-color: var(--f00-dark-light);
    color: #fff;
    border-color: #ffc107;
    box-shadow: 0 0 0 .25rem rgba(255, 193, 7, .25);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.form-select option {
    color: #000;
}

/* Pestañas (filtro de Proyectos) */
.nav-tabs {
    border-bottom-color: var(--f00-border);
}

.nav-tabs .nav-link {
    color: #ccc;
    border: 1px solid transparent;
}

.nav-tabs .nav-link.active {
    background-color: var(--f00-dark-light);
    color: #ffc107;
    border-color: var(--f00-border) var(--f00-border) var(--f00-dark-light);
}

/* Tarjeta de error genérica y alertas siguen con los colores de Bootstrap
   (fondo pastel propio, con suficiente contraste sobre el fondo oscuro). */

/* Timeline de fases del proyecto */
.f00-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    gap: .25rem;
}

.f00-timeline::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 5%;
    right: 5%;
    height: 2px;
    background: var(--f00-border);
}

.f00-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.f00-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 0 auto .4rem;
    background: var(--f00-dark);
    border: 2px solid #495057;
    position: relative;
}

.f00-step.done .f00-dot {
    background: #ffc107;
    border-color: #ffc107;
}

.f00-step.current .f00-dot {
    background: var(--f00-dark);
    border-color: #ffc107;
    box-shadow: 0 0 0 4px rgba(255, 193, 7, .25);
}

.f00-label {
    font-size: .75rem;
    color: #adb5bd;
    text-transform: capitalize;
}

.f00-step.current .f00-label {
    color: #ffc107;
    font-weight: 600;
}

/* Calendario */
.f00-dot-tipo {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: .3rem;
}

.f00-cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--f00-border);
    border-radius: .5rem;
    overflow: hidden;
    background: var(--f00-dark-light);
}

.f00-cal-head {
    padding: .4rem;
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
    color: #adb5bd;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--f00-border);
}

.f00-cal-day {
    min-height: 105px;
    padding: .3rem;
    border-right: 1px solid var(--f00-border);
    border-bottom: 1px solid var(--f00-border);
    overflow: hidden;
}

.f00-cal.semana .f00-cal-day {
    min-height: 320px;
}

.f00-cal-day:nth-child(7n + 7) {
    border-right: 0;
}

.f00-cal-day.fuera {
    opacity: .4;
}

.f00-cal-day.hoy {
    background: rgba(255, 193, 7, 0.08);
}

.f00-cal-day.hoy .f00-cal-num {
    background: #ffc107;
    color: #000;
    border-radius: 50%;
    padding: 0 .4rem;
    font-weight: 700;
}

.f00-cal-num {
    font-size: .8rem;
}

.f00-cal-add {
    font-size: .9rem;
    text-decoration: none;
    opacity: 0;
    transition: opacity .15s;
}

.f00-cal-day:hover .f00-cal-add {
    opacity: 1;
}

.f00-evento {
    display: block;
    margin-top: .2rem;
    padding: .1rem .35rem;
    font-size: .75rem;
    line-height: 1.25;
    color: #f1f1f1;
    background: rgba(255, 255, 255, 0.07);
    border-left: 3px solid #6c757d;
    border-radius: .2rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.f00-cal.semana .f00-evento {
    white-space: normal;
}

.f00-evento:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Layout del portal: topbar + sidebar + contenido + footer */
.f00-topbar {
    min-height: var(--f00-topbar-h);
    padding: .5rem 0;
    border-bottom: 1px solid var(--f00-border);
}

.f00-shell {
    display: flex;
    min-height: calc(100vh - var(--f00-topbar-h));
}

.f00-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.f00-main {
    flex: 1 1 auto;
    padding: 1.5rem 1.5rem 2rem;
}

.f00-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .9rem 1.5rem;
    font-size: .8rem;
    color: #adb5bd;
    border-top: 1px solid var(--f00-border);
}

.f00-sidebar {
    background: #0c0c0c;
    border-right: 1px solid var(--f00-border);
    color: #f1f1f1;
    --bs-offcanvas-width: 250px;
}

@media (min-width: 992px) {
    .f00-sidebar {
        flex: 0 0 230px;
        width: 230px;
        position: sticky;
        top: var(--f00-topbar-h);
        height: calc(100vh - var(--f00-topbar-h));
        overflow-y: auto;
        padding-top: 1rem;
    }
}

.f00-side-title {
    padding: .25rem 1.25rem;
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6c757d;
}

.f00-side-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem 1.25rem;
    color: #ced4da;
    text-decoration: none;
    border-left: 3px solid transparent;
    font-size: .92rem;
}

.f00-side-link i {
    width: 1.1rem;
    text-align: center;
    color: #6c757d;
}

.f00-side-link:hover {
    background: rgba(255, 255, 255, .05);
    color: #fff;
}

.f00-side-link.active {
    background: rgba(255, 193, 7, .1);
    border-left-color: #ffc107;
    color: #ffc107;
}

.f00-side-link.active i {
    color: #ffc107;
}

/* Notificaciones */
.f00-notif-menu {
    width: 340px;
    max-width: 92vw;
    background: var(--f00-dark-light);
    color: #f1f1f1;
    border-color: var(--f00-border);
}

.f00-notif-list {
    max-height: 320px;
    overflow-y: auto;
}

.f00-notif-item {
    display: flex;
    gap: .75rem;
    padding: .6rem 1rem;
    color: #f1f1f1;
    text-decoration: none;
    border-bottom: 1px solid var(--f00-border);
    font-size: .85rem;
}

.f00-notif-item i {
    color: #ffc107;
    margin-top: .2rem;
}

.f00-notif-item.nueva {
    background: rgba(255, 193, 7, .07);
}

.f00-notif-item:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

/* Modales y toasts oscuros */
.modal-content {
    background: var(--f00-dark-light);
    color: #f1f1f1;
    border: 1px solid var(--f00-border);
}

.modal-header, .modal-footer {
    border-color: var(--f00-border);
}

.dropdown-menu {
    background: var(--f00-dark-light);
    border-color: var(--f00-border);
}

/* Tarjetas reutilizables (proyecto / release) */
.f00-card {
    height: 100%;
    transition: transform .15s, border-color .15s;
}

.f00-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 193, 7, .5);
}

.f00-card .f00-card-cover {
    height: 120px;
    background: linear-gradient(135deg, #2a2a2a, #111);
    background-size: cover;
    background-position: center;
    border-radius: .375rem .375rem 0 0;
}

.f00-card a.stretched-link {
    text-decoration: none;
    color: #fff;
}

/* Marca de agua: el logo 00Rec de fondo (queda detrás de tarjetas y tablas, que son opacas) */
body::before {
    content: "";
    position: fixed;
    top: var(--f00-topbar-h);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
    background: url('/template/images/logo-00rec-blanco.png') no-repeat right 2rem top 1.5rem;
    background-size: min(60vh, 560px);
    opacity: .06;
}

@media (min-width: 992px) {
    body.f00-auth::before {
        left: 230px;
    }
}

/* Encabezado de grupo (área) dentro de la lista de tareas */
.f00-grupo-tareas {
    background: rgba(255, 193, 7, .08) !important;
    border-top: 1px solid rgba(255, 193, 7, .25) !important;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Insignias de "Mis tareas" que filtran al hacer clic */
.f00-badge-filtro { cursor: pointer; transition: transform .1s ease, box-shadow .1s ease; }
.f00-badge-filtro:hover { transform: translateY(-1px); filter: brightness(1.1); }
.f00-badge-filtro.activo { box-shadow: 0 0 0 2px var(--f00-dark, #111), 0 0 0 4px #fff; }

/* Visor del presupuesto (Finanzas) */
.f00-fin-scroll { max-height: 70vh; overflow: auto; }
.f00-fin-tabla thead th { position: sticky; top: 0; z-index: 2; background: var(--f00-dark, #1a1a1a); white-space: nowrap; }
.f00-fin-tabla td { white-space: nowrap; }
.f00-fin-tabla td:nth-child(2), .f00-fin-tabla td:nth-child(12) { white-space: normal; }
.f00-fin-subtotal > td { background: rgba(255, 193, 7, .10) !important; }
.f00-fin-total > td { background: rgba(255, 193, 7, .18) !important; }

/* Resumen de Finanzas: tarjetas con aire, encabezados legibles y cifras alineadas */
.f00-fin-card .card-header { padding: .9rem 1.25rem; font-weight: 600; }
.f00-fin-card .table { margin: 0; }
.f00-fin-card .table > :not(caption) > * > * { padding: .7rem 1.25rem; }
.f00-fin-card .table thead th {
    font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: #adb5bd; white-space: nowrap;
    border-bottom: 1px solid rgba(255, 193, 7, .35);
}
.f00-fin-card .table tbody tr:last-child > * { border-bottom: 0; }
.f00-fin-card td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Tarjetas de cifras clave */
.f00-fin-kpi .card-body { padding: 1.4rem 1.5rem; }
.f00-fin-kpi-titulo { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #adb5bd; margin-bottom: .5rem; }
.f00-fin-kpi-valor { font-size: 1.85rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.f00-fin-kpi-sub { font-size: 1.05rem; color: #ced4da; font-variant-numeric: tabular-nums; }
.f00-fin-tabla > :not(caption) > * > * { padding: .5rem .85rem; }
.f00-fin-tabla td.num, .f00-fin-tabla td.text-end { font-variant-numeric: tabular-nums; }

/* Presupuesto: letra más pequeña y las primeras 6 columnas (hasta "Fuente") congeladas al desplazarse a la derecha */
.f00-fin-congelada { font-size: .8rem; } /* la misma reducción aplica a .f00-fin-compacta (Base de datos) */
.f00-fin-congelada thead th { font-size: .74rem; }
.f00-fin-congelada > :not(caption) > * > * { padding: .4rem .7rem; }

/* anchos fijos para que los desplazamientos (left) de las columnas congeladas sean exactos */
.f00-fin-congelada th:nth-child(-n+6), .f00-fin-congelada td:nth-child(-n+6) { position: sticky; box-sizing: border-box; }
.f00-fin-congelada th:nth-child(1), .f00-fin-congelada td:nth-child(1) { left: 0;        width: 8.5rem;  min-width: 8.5rem;  max-width: 8.5rem; }
.f00-fin-congelada th:nth-child(2), .f00-fin-congelada td:nth-child(2) { left: 8.5rem;    width: 19rem;   min-width: 19rem;   max-width: 19rem;   white-space: normal; }
.f00-fin-congelada th:nth-child(3), .f00-fin-congelada td:nth-child(3) { left: 27.5rem;   width: 5rem;    min-width: 5rem;    max-width: 5rem; }
.f00-fin-congelada th:nth-child(4), .f00-fin-congelada td:nth-child(4) { left: 32.5rem;   width: 8rem;    min-width: 8rem;    max-width: 8rem; }
.f00-fin-congelada th:nth-child(5), .f00-fin-congelada td:nth-child(5) { left: 40.5rem;   width: 8rem;    min-width: 8rem;    max-width: 8rem; }
.f00-fin-congelada th:nth-child(6), .f00-fin-congelada td:nth-child(6) { left: 48.5rem;   width: 7rem;    min-width: 7rem;    max-width: 7rem;    box-shadow: 2px 0 0 rgba(255, 193, 7, .35); }

/* las celdas congeladas deben ser opacas para tapar lo que pasa por debajo */
.f00-fin-congelada tbody td:nth-child(-n+6) { background-color: var(--f00-dark-light) !important; z-index: 1; }
.f00-fin-congelada tbody tr:hover > td:nth-child(-n+6) { background-color: #2a2a2a !important; }
.f00-fin-congelada tbody tr.f00-fin-subtotal > td:nth-child(-n+6) { background-color: #2b2410 !important; }
.f00-fin-congelada tbody tr.f00-fin-total > td:nth-child(-n+6) { background-color: #362c0c !important; }
.f00-fin-congelada thead th:nth-child(-n+6) { z-index: 4; background: var(--f00-dark) !important; }
.f00-fin-congelada thead th:nth-child(n+7) { z-index: 3; }

/* En pantallas angostas las 6 columnas congeladas ocuparían casi todo el ancho: se desactiva el congelado */
@media (max-width: 991.98px) {
    .f00-fin-congelada th:nth-child(-n+6), .f00-fin-congelada td:nth-child(-n+6) {
        position: static; width: auto; min-width: 0; max-width: none; box-shadow: none;
    }
    .f00-fin-congelada thead th { position: sticky; top: 0; }
}

/* Base de datos: misma letra reducida que el Presupuesto */
.f00-fin-compacta { font-size: .8rem; }
.f00-fin-compacta thead th { font-size: .74rem; }
.f00-fin-compacta > :not(caption) > * > * { padding: .4rem .7rem; }

/* Pantalla completa de tablas anchas (Presupuesto y Base de datos) */
.f00-fin-panel:fullscreen { background: var(--f00-dark); padding: 1rem 1.25rem; display: flex; flex-direction: column; overflow: hidden; }
.f00-fin-panel:-webkit-full-screen { background: var(--f00-dark); padding: 1rem 1.25rem; display: flex; flex-direction: column; overflow: hidden; }
.f00-fin-panel.f00-fs-fallback { position: fixed; inset: 0; z-index: 2000; background: var(--f00-dark); padding: 1rem 1.25rem; display: flex; flex-direction: column; overflow: hidden; }
.f00-fin-panel:fullscreen .f00-fin-scroll { max-height: none; flex: 1 1 auto; min-height: 0; }
.f00-fin-panel:-webkit-full-screen .f00-fin-scroll { max-height: none; flex: 1 1 auto; min-height: 0; }
.f00-fin-panel.f00-fs-fallback .f00-fin-scroll { max-height: none; flex: 1 1 auto; min-height: 0; }
.f00-fin-panel .f00-fin-fs-titulo { display: none; }
.f00-fin-panel.f00-fs-activo .f00-fin-fs-titulo { display: inline; }
html.f00-fs-bloqueo { overflow: hidden; }
