/**
 * Dashboard de empleado (Inicio)
 * Layout tipo Factorial sobre tokens de billOS
 */

.inicio-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 20px 28px;
}

.inicio-row {
    display: grid;
    gap: 16px;
    overflow: visible;
    position: relative;
}

.inicio-row:first-child {
    z-index: 3;
}

.inicio-row:has(.inicio-fichaje.is-menu-open) {
    z-index: 20;
}

.inicio-row-3 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.inicio-row-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.inicio-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.04);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
    animation: inicioSlideIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.inicio-card:hover {
    border-color: #d1d5db;
}

.inicio-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.inicio-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.inicio-card-title a {
    color: inherit;
    text-decoration: none;
}

.inicio-card-title a:hover {
    color: #6366f1;
}

.inicio-chevron {
    color: #9ca3af;
    flex-shrink: 0;
}

.inicio-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.inicio-link {
    border: 0;
    background: none;
    color: #6366f1;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.inicio-link:hover {
    text-decoration: underline;
}

.inicio-empty {
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
    padding: 22px 8px;
}

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

/* —— Fichaje hero —— */
.inicio-fichaje {
    align-items: center;
    text-align: center;
    padding: 22px 20px 18px;
    position: relative;
    z-index: 2;
    overflow: visible;
}

.inicio-fichaje.is-menu-open {
    z-index: 40;
}

.inicio-fichaje-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 14px;
}

.inicio-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
}

.inicio-dot.is-working { background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15); }
.inicio-dot.is-pause { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16); }

.inicio-ring-wrap {
    position: relative;
    width: 168px;
    height: 168px;
    margin: 0 auto 12px;
}

.inicio-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.inicio-ring-bg {
    fill: none;
    stroke: #f3f4f6;
    stroke-width: 10;
}

.inicio-ring-progress {
    fill: none;
    stroke: #10b981;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease, stroke 0.3s ease;
}

.inicio-ring-progress.is-pause { stroke: #f59e0b; }
.inicio-ring-progress.is-idle { stroke: #d1d5db; }

.inicio-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.inicio-ring-time {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.inicio-ring-sub {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.inicio-fichaje-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    position: relative;
}

.inicio-btn {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.inicio-btn:hover {
    border-color: #c7c9d1;
    box-shadow: 0 1px 4px rgba(17, 24, 39, 0.06);
}

.inicio-btn-primary {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.inicio-btn-primary:hover {
    background: #1f2937;
    border-color: #1f2937;
}

.inicio-btn-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.inicio-fichaje-meta {
    margin-top: 12px;
    font-size: 12px;
    color: #6b7280;
}

.inicio-pausa-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.1);
    padding: 6px;
    z-index: 5;
    min-width: 160px;
    display: none;
}

.inicio-pausa-menu.is-open { display: block; }

.inicio-pausa-menu button {
    width: 100%;
    text-align: left;
    border: 0;
    background: none;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    color: #374151;
}

.inicio-pausa-menu button:hover { background: #f3f4f6; }

/* —— Inbox / listas —— */
.inicio-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 10px;
    cursor: pointer;
}

.inicio-item:hover { background: #f9fafb; }

.inicio-item.is-unread .inicio-item-title { font-weight: 700; }

.inicio-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    background: #fef2f2;
}

.inicio-item-icon.is-task { background: #eef2ff; }
.inicio-item-icon.is-event { background: #ecfdf5; }
.inicio-item-icon.is-teo { background: #f5f3ff; }

.inicio-item-body { min-width: 0; flex: 1; }

.inicio-item-title {
    font-size: 13px;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inicio-item-sub {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

/* —— Mi día (tareas + eventos de hoy, estética "Próximos cargos") —— */
.inicio-midia-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.inicio-midia-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

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

.inicio-midia-item:hover {
    background: #f9fafb;
}

.inicio-midia-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inicio-midia-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.inicio-midia-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inicio-midia-sub {
    font-size: 11.5px;
    color: #9ca3af;
}

.inicio-midia-meta {
    flex-shrink: 0;
}

.inicio-midia-hora {
    font-size: 12.5px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

/* —— Eventos pastillas —— */
.inicio-event {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f9fafb;
}

.inicio-event-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.inicio-event-tag {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    border-radius: 8px;
    padding: 4px 8px;
    white-space: nowrap;
}

/* —— Tareas —— */
.inicio-task {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
}

.inicio-task-check {
    width: 18px;
    height: 18px;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

.inicio-task-check:hover { border-color: #6366f1; }

.inicio-task-title {
    flex: 1;
    font-size: 13px;
    color: #111827;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inicio-chip {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 999px;
    padding: 3px 7px;
}

.inicio-chip-alta { background: #fef2f2; color: #b91c1c; }
.inicio-chip-media { background: #fffbeb; color: #b45309; }
.inicio-chip-baja { background: #f3f4f6; color: #6b7280; }
.inicio-chip-pendiente { background: #fffbeb; color: #b45309; }
.inicio-chip-aprobada { background: #ecfdf5; color: #047857; }
.inicio-chip-rechazada { background: #fef2f2; color: #b91c1c; }

/* —— Vacaciones —— */
.inicio-vac-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.inicio-vac-stat {
    background: #f9fafb;
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
}

.inicio-vac-stat strong {
    display: block;
    font-size: 18px;
    color: #111827;
}

.inicio-vac-stat span {
    font-size: 11px;
    color: #6b7280;
}

/* —— Equipo 2x2 —— */
.inicio-equipo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.inicio-equipo-cell {
    background: #f9fafb;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inicio-equipo-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.inicio-equipo-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.inicio-equipo-icon.is-out { background: #eff6ff; }
.inicio-equipo-icon.is-wait { background: #fef2f2; }
.inicio-equipo-icon.is-ok { background: #ecfdf5; }
.inicio-equipo-icon.is-pause { background: #fff7ed; }

.inicio-equipo-num {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.inicio-equipo-label {
    font-size: 12px;
    color: #6b7280;
}

/* —— Fichajes / extras / nómina —— */
.inicio-fichaje-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 2px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.inicio-fichaje-row:last-child { border-bottom: 0; }

.inicio-nomina-amount {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.03em;
}

.inicio-nomina-period {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.inicio-nomina-download {
    margin-top: 10px;
}

@keyframes inicioSlideIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body.app-entering .inicio-card {
    animation-play-state: paused;
}

@media (max-width: 1200px) {
    .inicio-row-3 { grid-template-columns: 1fr 1fr; }
    .inicio-fichaje { grid-column: 1 / -1; }
    .inicio-row-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .inicio-container { padding: 0 12px 24px; }
    .inicio-row-3,
    .inicio-row-4 { grid-template-columns: 1fr; }
    .inicio-fichaje { grid-column: auto; }
}
